Skip to content

Commit

Permalink
Use fast build for CI assets
Browse files Browse the repository at this point in the history
  • Loading branch information
crohr committed Nov 6, 2023
1 parent 81f105b commit 8ff5d71
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docker/ci/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ reset_dbs() {
}

precompile_assets() {
execute "JOBS=8 npm install"
execute_quiet "DATABASE_URL=nulldb://db bin/rails openproject:plugins:register_frontend assets:precompile"
execute "JOBS=8 time npm install"
execute_quiet "DATABASE_URL=nulldb://db time bin/rails openproject:plugins:register_frontend assets:precompile"
execute_quiet "cp -rp config/frontend_assets.manifest.json public/assets/frontend_assets.manifest.json"
# ls -al frontend/.angular/cache/
# find frontend/.angular/cache -type d -exec sh -c 'ls -dt "$1"/*/ | tail -n +2 | xargs rm -r' sh {} \;
Expand Down
16 changes: 16 additions & 0 deletions frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,22 @@
"with": "src/environments/environment.prod.ts"
}
]
},
"ci": {
"index": "",
"preserveSymlinks": true,
"optimization": false,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": false,
"buildOptimizer" : false,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
},
"scripts": {
"analyze": "ng build --configuration production --stats-json && webpack-bundle-analyzer -h 0.0.0.0 -p 9999 ../public/assets/frontend/stats.json",
"build:ci": "node ./node_modules/@angular/cli/bin/ng build --configuration production --named-chunks --source-map=false",
"build:ci": "node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --configuration ci",
"build:fast": "OPENPROJECT_ANGULAR_UGLIFY=false node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --configuration fastprod",
"build": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --configuration production --named-chunks --source-map",
"build:watch": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --watch --named-chunks",
Expand Down

0 comments on commit 8ff5d71

Please sign in to comment.