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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Add CI benchmark script
Cyril Rohrff91def68078
diff --git a/docker/ci/benchmark.sh b/docker/ci/benchmark.shnew file mode 100755index 00000000000..8b27aa23bd4--- /dev/null+++ b/docker/ci/benchmark.sh@@ -0,0 +1,20 @@+#!/bin/bash -ex+# This script can be used to quickly launch a full test run on any ubuntu-based VM+#+# cat benchmark.sh | ssh root@VM bash -s BRANCH -ex -++BRANCH="${1:=dev}"++sudo install -m 0755 -d /etc/apt/keyrings+curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg+sudo chmod a+r /etc/apt/keyrings/docker.gpg+echo \+ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \+ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \+ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null+sudo apt-get update -qq+sudo apt-get install -y git docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin++useradd -m -d /home/dev -s /bin/bash -G docker dev+su - dev -c "git clone https://github.com/opf/openproject --depth=1 --branch=$BRANCH"+su - dev -c 'cd openproject && time docker compose -f docker-compose.ci.yml run --build ci setup-tests run-units run-features'\ No newline at end of filediff --git a/docker/ci/entrypoint.sh b/docker/ci/entrypoint.shindex ecd81a2406f..ea43547a95a 100755--- a/docker/ci/entrypoint.sh+++ b/docker/ci/entrypoint.sh@@ -26,13 +26,13 @@ if [ $(id -u) -eq 0 ]; thenchown $USER:$USER /home/$USER/openproject/frontend/node_moduleschown $USER:$USER /home/$USER/openproject/frontend/.angularchown $USER:$USER /home/$USER/openproject/tmp- chown $USER:$USER /cache+ chown -R $USER:$USER /cachefiexecute() {- echo "[execute] $@"- local ret=0+ BANNER=${BANNER:="[execute]"}+ echo "$BANNER $@" >&2if [ $(id -u) -eq 0 ]; thensu $USER -c "$@"else@@ -41,19 +41,19 @@ execute() {}execute_quiet() {- local ret=0- echo "[execute_quiet] $@"- if ! execute "$@" >/tmp/op-output.log ; then- ret=$?+ if ! BANNER="[execute_quiet]" execute "$@" >/tmp/op-output.log ; thencat /tmp/op-output.log+ return 1+ else+ return 0fi- return $ret}cleanup() {+ echo "CLEANUP"rm -rf tmp/cache/parallel*rm -f /tmp/op-output.log- [ -d tmp/features ] && mv tmp/features spec/+ if [ -d tmp/features ]; then mv tmp/features spec/ ; fi}trap cleanup INT TERM EXIT@@ -81,22 +81,22 @@ fiif [ "$1" == "run-units" ]; thenshift- execute_quiet "cp -f /cache/turbo_runtime_units.log spec/support/"+ execute_quiet "cp -f /cache/turbo_runtime_units.log spec/support/ || true"# turbo_tests cannot yet exclude specific directories, so copying spec/features elsewhere (temporarily)execute_quiet "mv spec/features tmp/"execute_quiet "time bundle exec rails zeitwerk:check"execute "time bundle exec turbo_tests -n $JOBS --runtime-log spec/support/turbo_runtime_units.log spec"- execute_quiet "cp -f spec/support/turbo_runtime_units.log /cache/"+ execute_quiet "cp -f spec/support/turbo_runtime_units.log /cache/ || true"cleanupfiif [ "$1" == "run-features" ]; thenshift- execute_quiet "cp -f /cache/turbo_runtime_features.log spec/support/"+ execute_quiet "cp -f /cache/turbo_runtime_features.log spec/support/ || true"execute_quiet "time bundle exec rails assets:precompile"execute_quiet "cp -rp config/frontend_assets.manifest.json public/assets/frontend_assets.manifest.json"execute "time bundle exec turbo_tests -n $JOBS --runtime-log spec/support/turbo_runtime_features.log spec/features"- execute_quiet "cp -f spec/support/turbo_runtime_features.log /cache/"+ execute_quiet "cp -f spec/support/turbo_runtime_features.log /cache/ || true"cleanupfi