debian-mirror-gitlab/.gitlab/ci/review.gitlab-ci.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

92 lines
2.9 KiB
YAML
Raw Normal View History

2020-05-24 23:13:21 +05:30
review-cleanup:
2019-12-21 20:55:43 +05:30
extends:
- .default-retry
2020-03-13 15:44:24 +05:30
- .review:rules:review-cleanup
2022-08-27 11:52:29 +05:30
image: ${REVIEW_APPS_IMAGE}
2019-12-21 20:55:43 +05:30
stage: prepare
environment:
2023-01-13 00:05:48 +05:30
name: review/regular-cleanup
2019-12-21 20:55:43 +05:30
action: stop
before_script:
- source scripts/utils.sh
2020-05-24 23:13:21 +05:30
- source scripts/review_apps/gcp_cleanup.sh
2019-12-21 20:55:43 +05:30
- install_gitlab_gem
2020-05-24 23:13:21 +05:30
- setup_gcp_dependencies
2019-12-21 20:55:43 +05:30
script:
2022-11-25 23:54:43 +05:30
- scripts/review_apps/automated_cleanup.rb
2020-04-22 19:07:51 +05:30
- gcp_cleanup
2021-11-18 22:05:49 +05:30
start-review-app-pipeline:
2020-07-28 23:09:34 +05:30
extends:
2022-01-26 12:08:38 +05:30
- .review:rules:start-review-app-pipeline
2023-01-13 00:05:48 +05:30
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-11-18 22:05:49 +05:30
stage: review
2020-07-28 23:09:34 +05:30
needs:
2022-10-11 01:57:18 +05:30
- job: e2e-test-pipeline-generate
2021-11-18 22:05:49 +05:30
- job: build-assets-image
2020-07-28 23:09:34 +05:30
artifacts: false
2021-11-18 22:05:49 +05:30
# 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
2021-10-27 15:23:28 +05:30
variables:
2022-08-13 15:12:31 +05:30
SCHEDULE_TYPE: $SCHEDULE_TYPE
2021-11-18 22:05:49 +05:30
DAST_RUN: $DAST_RUN
2022-10-11 01:57:18 +05:30
SKIP_MESSAGE: Skipping review-app due to mr containing only quarantine changes!
2021-11-18 22:05:49 +05:30
trigger:
2022-10-11 01:57:18 +05:30
strategy: depend
2021-11-18 22:05:49 +05:30
include:
2022-08-27 11:52:29 +05:30
- artifact: review-app-pipeline.yml
2022-10-11 01:57:18 +05:30
job: e2e-test-pipeline-generate
# 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
2021-09-04 01:27:46 +05:30
2019-07-31 22:56:46 +05:30
danger-review:
2019-12-04 20:38:33 +05:30
extends:
- .default-retry
2022-11-25 23:54:43 +05:30
- .ruby-node-cache
2020-03-13 15:44:24 +05:30
- .review:rules:danger
2019-07-31 22:56:46 +05:30
stage: test
2020-04-08 14:13:33 +05:30
needs: []
2021-04-17 20:07:23 +05:30
before_script:
2021-06-08 01:23:25 +05:30
- source scripts/utils.sh
- bundle_install_script "--with danger"
2022-11-25 23:54:43 +05:30
- yarn_install_script
2021-04-17 20:07:23 +05:30
script:
2022-08-27 11:52:29 +05:30
# ${DANGER_DANGERFILE} is used by Jihulab for customizing danger support: https://jihulab.com/gitlab-cn/gitlab/-/blob/main-jh/jh/.gitlab-ci.yml
2021-04-29 21:17:54 +05:30
- >
if [ -z "$DANGER_GITLAB_API_TOKEN" ]; then
2021-09-30 23:02:18 +05:30
run_timed_command danger_as_local
2021-04-29 21:17:54 +05:30
else
2022-06-21 17:19:12 +05:30
danger_id=$(echo -n ${DANGER_GITLAB_API_TOKEN} | md5sum | awk '{print $1}' | cut -c5-10)
2022-08-27 11:52:29 +05:30
run_timed_command "bundle exec danger --fail-on-errors=true --verbose --danger_id=\"${danger_id}\" --dangerfile=\"${DANGER_DANGERFILE:-Dangerfile}\""
2021-04-29 21:17:54 +05:30
fi
2021-09-30 23:02:18 +05:30
danger-review-local:
extends:
- danger-review
- .review:rules:danger-local
script:
- run_timed_command danger_as_local