Skip to content
代码片段 群组 项目
提交 5674fcc0 编辑于 作者: Jennifer Li's avatar Jennifer Li
浏览文件

Run puma config test jobs with custom exit code

上级 343294d5
No related branches found
No related tags found
2 合并请求!3031Merge per-main-jh to main-jh by luzhiyuan,!3030Merge per-main-jh to main-jh
...@@ -36,13 +36,18 @@ rails-production-server-boot-puma-example: ...@@ -36,13 +36,18 @@ rails-production-server-boot-puma-example:
extends: extends:
- .rails-production-server-boot - .rails-production-server-boot
script: script:
- cp config/puma.rb.example config/puma.rb - |
- sed --in-place "s:/home/git/gitlab:${PWD}:" config/puma.rb function test_puma_config_example() {
- echo 'bind "tcp://127.0.0.1:3000"' >> config/puma.rb cp config/puma.rb.example config/puma.rb
- bundle exec puma --environment production --config config/puma.rb & sed --in-place "s:/home/git/gitlab:${PWD}:" config/puma.rb
- sleep 50 # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114124#note_1309506358 echo 'bind "tcp://127.0.0.1:3000"' >> config/puma.rb
- retry_times_sleep 10 5 "curl http://127.0.0.1:3000" bundle exec puma --environment production --config config/puma.rb &
- kill $(jobs -p) sleep 50 # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114124#note_1309506358
retry_times_sleep 10 5 "curl http://127.0.0.1:3000"
kill $(jobs -p)
}
run_with_custom_exit_code test_puma_config_example
# Test the puma configuration present in # Test the puma configuration present in
# https://gitlab.com/gitlab-org/build/CNG/-/raw/master/gitlab-webservice/configuration/puma.rb # https://gitlab.com/gitlab-org/build/CNG/-/raw/master/gitlab-webservice/configuration/puma.rb
...@@ -50,14 +55,19 @@ rails-production-server-boot-puma-cng: ...@@ -50,14 +55,19 @@ rails-production-server-boot-puma-cng:
extends: extends:
- .rails-production-server-boot - .rails-production-server-boot
script: script:
- define_trigger_branch_in_build_env - |
- echo "TRIGGER_BRANCH is defined as ${TRIGGER_BRANCH}" function test_puma_config_cng() {
- curl --silent "https://gitlab.com/gitlab-org/build/CNG/-/raw/${TRIGGER_BRANCH}/gitlab-webservice/configuration/puma.rb" > config/puma.rb define_trigger_branch_in_build_env
- sed --in-place "s:/srv/gitlab:${PWD}:" config/puma.rb echo "TRIGGER_BRANCH is defined as ${TRIGGER_BRANCH}"
- bundle exec puma --environment production --config config/puma.rb & curl --silent "https://gitlab.com/gitlab-org/build/CNG/-/raw/${TRIGGER_BRANCH}/gitlab-webservice/configuration/puma.rb" > config/puma.rb
- sleep 50 # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114124#note_1309506358 sed --in-place "s:/srv/gitlab:${PWD}:" config/puma.rb
- retry_times_sleep 10 5 "curl http://127.0.0.1:8080" bundle exec puma --environment production --config config/puma.rb &
- kill $(jobs -p) sleep 50 # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114124#note_1309506358
retry_times_sleep 10 5 "curl http://127.0.0.1:8080"
kill $(jobs -p)
}
run_with_custom_exit_code test_puma_config_cng
ruby_syntax: ruby_syntax:
extends: extends:
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册