Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Use fast build for CI assets

Cyril Rohr8ff5d7117ad7
diff --git a/docker/ci/entrypoint.sh b/docker/ci/entrypoint.sh
index 9937151f23f..116c53ea866 100755
--- a/docker/ci/entrypoint.sh
+++ b/docker/ci/entrypoint.sh
@@ -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 {} \;
diff --git a/frontend/angular.json b/frontend/angular.json
index 5cba3a9eb06..5c9e5bd2c63 100644
--- a/frontend/angular.json
+++ b/frontend/angular.json
@@ -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"
+ }
+ ]
}
}
},
diff --git a/frontend/package.json b/frontend/package.json
index ee8013e1000..d552b137aca 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -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",