2022-04-15 14:09:57 -04:00
include :
- remote : 'https://gitlab.com/gitlab-org/modelops/applied-ml/review-recommender/ci-templates/-/raw/v0.2.1/recommender/Reviewers.gitlab-ci.yml'
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
2019-09-18 14:06:14 -04:00
- ruby -rrubygems scripts/review_apps/automated_cleanup.rb
2020-03-30 23:07:51 -04:00
- gcp_cleanup
2021-10-14 11:14:02 -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 :
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
2021-10-14 11:14:02 -04:00
trigger :
include :
- local : .gitlab/ci/review-apps/main.gitlab-ci.yml
strategy : depend
2021-05-26 17:10:49 -04:00
2019-04-12 04:56:38 -04:00
danger-review :
2019-08-26 16:41:55 -04:00
extends :
- .default-retry
2021-03-12 07:09:33 -05:00
- .danger-review-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"
2020-10-08 14:08:32 -04:00
- run_timed_command "retry yarn install --frozen-lockfile"
2021-03-12 07:09:33 -05:00
script :
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)
run_timed_command "bundle exec danger --fail-on-errors=true --verbose --danger_id=${danger_id}"
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
2022-04-15 14:09:57 -04:00
reviewers-recommender :
extends :
- .default-retry
2022-05-24 11:08:28 -04:00
- .review:rules:reviewers-recommender
2022-04-15 14:09:57 -04:00
stage : test
needs : [ ]