2020-04-21 14:09:31 -04:00
review-cleanup :
2019-09-18 14:06:14 -04:00
extends :
- .default-retry
2020-02-12 10:09:37 -05:00
- .review:rules:review-cleanup
2022-07-21 11:09:12 -04:00
image : ${REVIEW_APPS_IMAGE}
2022-07-21 17:10:17 -04:00
resource_group : review/${CI_COMMIT_REF_SLUG}${SCHEDULE_TYPE} # CI_ENVIRONMENT_SLUG is not available here and we want this to be the same as the environment
2019-09-18 14:06:14 -04:00
stage : prepare
environment :
2022-07-04 11:10:24 -04:00
name : review/${CI_COMMIT_REF_SLUG}${SCHEDULE_TYPE} # No separator for SCHEDULE_TYPE so it's compatible as before and looks nice without it
2019-09-18 14:06:14 -04:00
action : stop
before_script :
- source scripts/utils.sh
2021-12-15 10:15:54 -05:00
- source scripts/review_apps/review-apps.sh
2020-04-21 14:09:31 -04:00
- source scripts/review_apps/gcp_cleanup.sh
2019-09-18 14:06:14 -04:00
- install_gitlab_gem
2020-04-21 14:09:31 -04:00
- setup_gcp_dependencies
2019-09-18 14:06:14 -04:00
script :
2021-12-13 16:14:32 -05:00
- delete_release
2021-12-15 10:15:54 -05:00
- delete_namespace
2022-10-13 08:10:13 -04:00
- scripts/review_apps/automated_cleanup.rb
2020-03-30 23:07:51 -04:00
- gcp_cleanup
2022-08-25 23:12:38 -04:00
start-review-app-pipeline :
2020-06-30 11:08:48 -04:00
extends :
2021-11-17 22:14:17 -05:00
- .review:rules:start-review-app-pipeline
2022-07-21 17:10:17 -04:00
resource_group : review/${CI_COMMIT_REF_SLUG}${SCHEDULE_TYPE} # CI_ENVIRONMENT_SLUG is not available here and we want this to be the same as the environment
2021-10-14 11:14:02 -04:00
stage : review
2020-06-30 11:08:48 -04:00
needs :
2022-09-05 23:12:08 -04:00
- job : e2e-test-pipeline-generate
2021-10-14 11:14:02 -04:00
- job : build-assets-image
2020-06-30 11:08:48 -04:00
artifacts : false
2021-10-18 05:12:29 -04:00
# These variables are set in the pipeline schedules.
# They need to be explicitly passed on to the child pipeline.
# https://docs.gitlab.com/ee/ci/pipelines/multi_project_pipelines.html#pass-cicd-variables-to-a-downstream-pipeline-by-using-the-variables-keyword
variables :
2022-07-04 11:10:24 -04:00
SCHEDULE_TYPE : $SCHEDULE_TYPE
2021-10-18 05:12:29 -04:00
DAST_RUN : $DAST_RUN
2022-09-05 23:12:08 -04:00
SKIP_MESSAGE : Skipping review-app due to mr containing only quarantine changes!
2021-10-14 11:14:02 -04:00
trigger :
2022-09-05 23:12:08 -04:00
strategy : depend
2021-10-14 11:14:02 -04:00
include :
2022-08-02 11:09:10 -04:00
- artifact : review-app-pipeline.yml
2022-09-05 23:12:08 -04:00
job : e2e-test-pipeline-generate
2021-05-26 17:10:49 -04:00
2022-09-15 11:13:49 -04:00
# Fetch child pipeline test results and store in parent pipeline
# workaround until natively implemented: https://gitlab.com/groups/gitlab-org/-/epics/8205
review-app-test-results :
image : ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3
stage : review
extends :
- .qa-cache
- .review:rules:start-review-app-pipeline
needs :
- start-review-app-pipeline
variables :
COLORIZED_LOGS : "true"
QA_LOG_LEVEL : "debug"
before_script :
- cd qa && bundle install
script :
- bundle exec rake "ci:download_test_results[start-review-app-pipeline,e2e-test-report,${CI_PROJECT_DIR}]"
when : always
allow_failure : true
artifacts :
when : always
reports :
junit : qa/tmp/rspec-*.xml
2019-04-12 04:56:38 -04:00
danger-review :
2019-08-26 16:41:55 -04:00
extends :
- .default-retry
2022-10-04 14:08:15 -04:00
- .ruby-node-cache
2020-02-12 10:09:37 -05:00
- .review:rules:danger
2019-04-12 04:56:38 -04:00
stage : test
2020-02-20 13:08:51 -05:00
needs : [ ]
2021-03-12 07:09:33 -05:00
before_script :
2021-05-14 14:10:34 -04:00
- source scripts/utils.sh
- bundle_install_script "--with danger"
2022-10-05 17:09:08 -04:00
- yarn_install_script
2021-03-12 07:09:33 -05:00
script :
2022-08-11 17:09:14 -04:00
# ${DANGER_DANGERFILE} is used by Jihulab for customizing danger support: https://jihulab.com/gitlab-cn/gitlab/-/blob/main-jh/jh/.gitlab-ci.yml
2021-03-31 14:09:19 -04:00
- >
if [ -z "$DANGER_GITLAB_API_TOKEN" ]; then
2021-07-15 08:09:01 -04:00
run_timed_command danger_as_local
2021-03-31 14:09:19 -04:00
else
2022-03-21 08:08:01 -04:00
danger_id=$(echo -n ${DANGER_GITLAB_API_TOKEN} | md5sum | awk '{print $1}' | cut -c5-10)
2022-08-11 17:09:14 -04:00
run_timed_command "bundle exec danger --fail-on-errors=true --verbose --danger_id=\"${danger_id}\" --dangerfile=\"${DANGER_DANGERFILE:-Dangerfile}\""
2021-03-31 14:09:19 -04:00
fi
2021-07-15 08:09:01 -04:00
danger-review-local :
extends :
- danger-review
- .review:rules:danger-local
script :
- run_timed_command danger_as_local