[ACA-3346] Fix build script (#1476)

* [ACA-3317] Improve build script

* Improve code

* Remove update-commit-sha.sh
This commit is contained in:
davidcanonieto 2020-05-22 00:45:55 +01:00 committed by GitHub
parent 51b461f859
commit cb1b3fa236
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 35 deletions

View File

@ -48,6 +48,7 @@ jobs:
- stage: Quality and Unit tests
name: 'Build (without animation)'
before_script: npx @alfresco/adf-cli update-commit-sha --pointer "HEAD" --pathPackage "$(pwd)"
script: npm ci && npm run build.e2e
after_success: ./scripts/ci/utils/artifact-to-s3.sh -a ./dist/app -o "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2"
cache: false

View File

@ -8,11 +8,11 @@
"ng": "ng",
"start": "npm run validate-config && ng serve --open",
"start:prod": "npm run validate-config && node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng serve --prod --open",
"build:aos-extension": "npm run update-commit-sha -- -gnu && npx rimraf dist/@alfresco/adf-office-services-ext && ng build adf-office-services-ext && cpr projects/adf-office-services-ext/ngi.json dist/@alfresco/adf-office-services-ext/ngi.json && cpr projects/adf-office-services-ext/assets dist/@alfresco/adf-office-services-ext/assets",
"build.shared": "npm run update-commit-sha -- -gnu && ng build aca-shared",
"build:aos-extension": "npx rimraf dist/@alfresco/adf-office-services-ext && ng build adf-office-services-ext && cpr projects/adf-office-services-ext/ngi.json dist/@alfresco/adf-office-services-ext/ngi.json && cpr projects/adf-office-services-ext/assets dist/@alfresco/adf-office-services-ext/assets",
"build.shared": "ng build aca-shared",
"build.aos": "npm run build:aos-extension",
"build.extensions": "npm run update-commit-sha -- -gnu && npm run build.shared && npm run build.aos",
"build.app": "npm run update-commit-sha -- -gnu && node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build app",
"build.extensions": "npm run build.shared && npm run build.aos",
"build.app": "node --max-old-space-size=8192 node_modules/@angular/cli/bin/ng build app",
"build": "npm run validate-config && npm run build.app -- --prod",
"build.e2e": "npm run build.app -- --prod --configuration=e2e",
"test": "ng test app --code-coverage",
@ -27,8 +27,7 @@
"e2e:docker": "./start.sh && npm run e2e && ./start.sh -d",
"spellcheck": "cspell '{src,e2e,projects}/**/*.ts'",
"inspect.bundle": "ng build app --prod --stats-json && npx webpack-bundle-analyzer dist/app/stats.json",
"validate-config": "ajv validate -s ./node_modules/@alfresco/adf-core/app.config.schema.json -d ./src/app.config.json --errors=text --verbose",
"update-commit-sha": "./scripts/update-commit-sha.sh"
"validate-config": "ajv validate -s ./node_modules/@alfresco/adf-core/app.config.schema.json -d ./src/app.config.json --errors=text --verbose"
},
"private": true,
"dependencies": {

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
eval GNU=false
show_help() {
echo "Usage: update-commit-sha.sh"
echo ""
echo "-gnu for gnu"
}
gnu_mode() {
echo "====== GNU MODE ====="
GNU=true
}
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
-gnu) gnu_mode; shift;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
esac
done
npm install @alfresco/adf-cli@alpha
if $GNU; then
./node_modules/@alfresco/adf-cli/bin/adf-cli update-commit-sha --pointer "HEAD" --pathPackage "$(pwd)"
else
./node_modules/@alfresco/adf-cli/bin/adf-cli update-commit-sha --pointer "HEAD" --pathPackage "$(pwd)" --skipGnu
fi