2020-04-21 18:09:31 +00:00
|
|
|
review-cleanup:
|
2019-09-18 18:06:14 +00:00
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-02-12 15:09:37 +00:00
|
|
|
- .review:rules:review-cleanup
|
2020-04-21 18:09:31 +00:00
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-helm3-kubectl1.14
|
2019-09-18 18:06:14 +00:00
|
|
|
stage: prepare
|
|
|
|
environment:
|
|
|
|
name: review/auto-cleanup
|
|
|
|
action: stop
|
|
|
|
before_script:
|
|
|
|
- source scripts/utils.sh
|
2020-04-21 18:09:31 +00:00
|
|
|
- source scripts/review_apps/gcp_cleanup.sh
|
2019-09-18 18:06:14 +00:00
|
|
|
- install_gitlab_gem
|
2020-04-21 18:09:31 +00:00
|
|
|
- setup_gcp_dependencies
|
2019-09-18 18:06:14 +00:00
|
|
|
script:
|
|
|
|
- ruby -rrubygems scripts/review_apps/automated_cleanup.rb
|
2020-03-31 03:07:51 +00:00
|
|
|
- gcp_cleanup
|
|
|
|
|
2020-10-08 18:08:32 +00:00
|
|
|
.base-before_script: &base-before_script
|
|
|
|
- source ./scripts/utils.sh
|
|
|
|
- source ./scripts/review_apps/review-apps.sh
|
|
|
|
- install_api_client_dependencies_with_apk
|
|
|
|
|
2020-06-30 15:08:48 +00:00
|
|
|
review-build-cng:
|
|
|
|
extends:
|
|
|
|
- .default-retry
|
|
|
|
- .review:rules:review-build-cng
|
2020-10-23 18:08:31 +00:00
|
|
|
image: ruby:2.7-alpine
|
2020-06-30 15:08:48 +00:00
|
|
|
stage: review-prepare
|
|
|
|
before_script:
|
2020-10-08 18:08:32 +00:00
|
|
|
- source ./scripts/utils.sh
|
2020-06-30 15:08:48 +00:00
|
|
|
- install_api_client_dependencies_with_apk
|
|
|
|
- install_gitlab_gem
|
|
|
|
needs:
|
|
|
|
- job: compile-production-assets
|
|
|
|
artifacts: false
|
|
|
|
script:
|
|
|
|
- BUILD_TRIGGER_TOKEN=$REVIEW_APPS_BUILD_TRIGGER_TOKEN ./scripts/trigger-build cng
|
|
|
|
# When the job is manual, review-deploy is also manual and we don't want people
|
|
|
|
# to have to manually start the jobs in sequence, so we do it for them.
|
2020-11-25 15:09:13 +00:00
|
|
|
- '[ -z $CI_JOB_MANUAL ] || scripts/api/play_job --job-name "review-deploy"'
|
2019-04-12 08:56:38 +00:00
|
|
|
|
2019-10-31 06:06:31 +00:00
|
|
|
.review-workflow-base:
|
2019-09-18 18:06:14 +00:00
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-04-07 18:09:19 +00:00
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-helm3-kubectl1.14
|
2019-04-12 08:56:38 +00:00
|
|
|
variables:
|
|
|
|
HOST_SUFFIX: "${CI_ENVIRONMENT_SLUG}"
|
2020-06-30 15:08:48 +00:00
|
|
|
REVIEW_APPS_DOMAIN: "temp.gitlab-review.app" # FIXME: using temporary domain
|
2019-04-12 08:56:38 +00:00
|
|
|
DOMAIN: "-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}"
|
2020-08-31 15:10:41 +00:00
|
|
|
GITLAB_HELM_CHART_REF: "v4.3.0"
|
2019-08-26 20:41:55 +00:00
|
|
|
environment:
|
2020-09-01 18:10:48 +00:00
|
|
|
name: review/${CI_COMMIT_REF_SLUG}${FREQUENCY}
|
2019-04-18 19:18:20 +00:00
|
|
|
url: https://gitlab-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}
|
2019-04-12 08:56:38 +00:00
|
|
|
on_stop: review-stop
|
2020-03-04 21:07:54 +00:00
|
|
|
auto_stop_in: 48 hours
|
2019-10-31 06:06:31 +00:00
|
|
|
|
2020-06-30 15:08:48 +00:00
|
|
|
review-deploy:
|
|
|
|
extends:
|
|
|
|
- .review-workflow-base
|
2020-08-27 15:10:21 +00:00
|
|
|
- .review:rules:review-deploy
|
2020-06-30 15:08:48 +00:00
|
|
|
stage: review
|
|
|
|
dependencies: []
|
|
|
|
resource_group: "review/${CI_COMMIT_REF_NAME}"
|
|
|
|
before_script:
|
|
|
|
- export GITLAB_SHELL_VERSION=$(<GITLAB_SHELL_VERSION)
|
|
|
|
- export GITALY_VERSION=$(<GITALY_SERVER_VERSION)
|
|
|
|
- export GITLAB_WORKHORSE_VERSION=$(<GITLAB_WORKHORSE_VERSION)
|
|
|
|
- echo "${CI_ENVIRONMENT_URL}" > environment_url.txt
|
2020-10-08 18:08:32 +00:00
|
|
|
- *base-before_script
|
2020-06-30 15:08:48 +00:00
|
|
|
script:
|
|
|
|
- check_kube_domain
|
|
|
|
- ensure_namespace
|
|
|
|
- install_external_dns
|
|
|
|
- download_chart
|
|
|
|
- date
|
|
|
|
- deploy || (display_deployment_debug && exit 1)
|
2020-10-05 12:08:47 +00:00
|
|
|
- disable_sign_ups || (delete_release && exit 1)
|
2020-06-30 15:08:48 +00:00
|
|
|
# When the job is manual, review-qa-smoke is also manual and we don't want people
|
|
|
|
# to have to manually start the jobs in sequence, so we do it for them.
|
2020-11-25 15:09:13 +00:00
|
|
|
- '[ -z $CI_JOB_MANUAL ] || scripts/api/play_job --job-name "review-qa-smoke"'
|
|
|
|
- '[ -z $CI_JOB_MANUAL ] || scripts/api/play_job --job-name "review-performance"'
|
2020-08-24 18:10:19 +00:00
|
|
|
after_script:
|
|
|
|
# Run seed-dast-test-data.sh only when DAST_RUN is set to true. This is to pupulate review app with data for DAST scan.
|
|
|
|
# Set DAST_RUN to true when jobs are manually scheduled.
|
|
|
|
- if [ "$DAST_RUN" == "true" ]; then source scripts/review_apps/seed-dast-test-data.sh; TRACE=1 trigger_proj_user_creation; fi
|
2020-06-30 15:08:48 +00:00
|
|
|
artifacts:
|
|
|
|
paths: [environment_url.txt]
|
2020-10-06 18:08:49 +00:00
|
|
|
expire_in: 7 days
|
2020-06-30 15:08:48 +00:00
|
|
|
when: always
|
2019-04-12 08:56:38 +00:00
|
|
|
|
2020-02-12 15:09:37 +00:00
|
|
|
.review-stop-base:
|
2019-12-27 12:07:59 +00:00
|
|
|
extends: .review-workflow-base
|
2019-04-18 19:18:20 +00:00
|
|
|
environment:
|
|
|
|
action: stop
|
2020-02-17 15:09:01 +00:00
|
|
|
dependencies: []
|
2019-08-26 20:41:55 +00:00
|
|
|
variables:
|
2019-12-27 18:08:12 +00:00
|
|
|
# We're cloning the repo instead of downloading the script for now
|
|
|
|
# because some repos are private and CI_JOB_TOKEN cannot access files.
|
|
|
|
# See https://gitlab.com/gitlab-org/gitlab/issues/191273
|
|
|
|
GIT_DEPTH: 1
|
2019-08-26 20:41:55 +00:00
|
|
|
before_script:
|
2020-10-08 18:08:32 +00:00
|
|
|
- *base-before_script
|
2019-04-18 19:18:20 +00:00
|
|
|
|
2019-11-01 18:06:00 +00:00
|
|
|
review-stop-failed-deployment:
|
2020-02-12 15:09:37 +00:00
|
|
|
extends:
|
|
|
|
- .review-stop-base
|
2020-05-07 09:09:51 +00:00
|
|
|
- .review:rules:review-stop-failed-deployment
|
2019-09-09 19:29:44 +00:00
|
|
|
stage: prepare
|
|
|
|
script:
|
|
|
|
- delete_failed_release
|
|
|
|
|
2019-10-31 06:06:31 +00:00
|
|
|
review-stop:
|
2020-02-12 15:09:37 +00:00
|
|
|
extends:
|
|
|
|
- .review-stop-base
|
2020-09-01 18:10:48 +00:00
|
|
|
- .review:rules:review-stop
|
|
|
|
stage: post-qa
|
2019-10-31 06:06:31 +00:00
|
|
|
script:
|
|
|
|
- delete_release
|
|
|
|
|
2020-06-30 15:08:48 +00:00
|
|
|
.review-qa-base:
|
|
|
|
extends:
|
|
|
|
- .default-retry
|
|
|
|
- .use-docker-in-docker
|
2020-10-23 18:08:31 +00:00
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7
|
2020-06-30 15:08:48 +00:00
|
|
|
stage: qa
|
|
|
|
# This is needed so that manual jobs with needs don't block the pipeline.
|
|
|
|
# See https://gitlab.com/gitlab-org/gitlab/-/issues/199979.
|
|
|
|
dependencies: ["review-deploy"]
|
|
|
|
variables:
|
|
|
|
QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa"
|
|
|
|
QA_CAN_TEST_GIT_PROTOCOL_V2: "false"
|
|
|
|
QA_DEBUG: "true"
|
|
|
|
GITLAB_USERNAME: "root"
|
|
|
|
GITLAB_PASSWORD: "${REVIEW_APPS_ROOT_PASSWORD}"
|
|
|
|
GITLAB_ADMIN_USERNAME: "root"
|
|
|
|
GITLAB_ADMIN_PASSWORD: "${REVIEW_APPS_ROOT_PASSWORD}"
|
|
|
|
GITHUB_ACCESS_TOKEN: "${REVIEW_APPS_QA_GITHUB_ACCESS_TOKEN}"
|
|
|
|
EE_LICENSE: "${REVIEW_APPS_EE_LICENSE}"
|
|
|
|
SIGNUP_DISABLED: "true"
|
|
|
|
before_script:
|
|
|
|
- export QA_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_COMMIT_REF_SLUG}"
|
|
|
|
- export CI_ENVIRONMENT_URL="$(cat environment_url.txt)"
|
|
|
|
- echo "${CI_ENVIRONMENT_URL}"
|
|
|
|
- echo "${QA_IMAGE}"
|
2020-10-08 18:08:32 +00:00
|
|
|
- *base-before_script
|
2020-06-30 15:08:48 +00:00
|
|
|
- gem install gitlab-qa --no-document ${GITLAB_QA_VERSION:+ --version ${GITLAB_QA_VERSION}}
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- ./qa/gitlab-qa-run-*
|
|
|
|
expire_in: 7 days
|
|
|
|
when: always
|
|
|
|
|
|
|
|
review-qa-smoke:
|
|
|
|
extends:
|
|
|
|
- .review-qa-base
|
|
|
|
- .review:rules:review-qa-smoke
|
|
|
|
script:
|
|
|
|
- gitlab-qa Test::Instance::Smoke "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}"
|
|
|
|
|
|
|
|
review-qa-all:
|
|
|
|
extends:
|
|
|
|
- .review-qa-base
|
|
|
|
- .review:rules:mr-only-manual
|
|
|
|
parallel: 5
|
|
|
|
script:
|
|
|
|
- export KNAPSACK_REPORT_PATH=knapsack/master_report.json
|
|
|
|
- export KNAPSACK_TEST_FILE_PATTERN=qa/specs/features/**/*_spec.rb
|
|
|
|
- gitlab-qa Test::Instance::Any "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}" -- --format RspecJunitFormatter --out tmp/rspec-${CI_JOB_ID}.xml --format html --out tmp/rspec.htm --color --format documentation
|
|
|
|
|
|
|
|
review-performance:
|
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-08-27 15:10:21 +00:00
|
|
|
- .review:rules:review-performance
|
2020-06-30 15:08:48 +00:00
|
|
|
image:
|
2020-09-18 18:10:26 +00:00
|
|
|
name: sitespeedio/sitespeed.io
|
2020-06-30 15:08:48 +00:00
|
|
|
entrypoint: [""]
|
|
|
|
stage: qa
|
|
|
|
# This is needed so that manual jobs with needs don't block the pipeline.
|
|
|
|
# See https://gitlab.com/gitlab-org/gitlab/-/issues/199979.
|
|
|
|
dependencies: ["review-deploy"]
|
|
|
|
before_script:
|
|
|
|
- export CI_ENVIRONMENT_URL="$(cat environment_url.txt)"
|
|
|
|
- echo "${CI_ENVIRONMENT_URL}"
|
|
|
|
- mkdir -p gitlab-exporter
|
|
|
|
- wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/master/index.js
|
|
|
|
- mkdir -p sitespeed-results
|
|
|
|
script:
|
|
|
|
- /start.sh --plugins.add ./gitlab-exporter --outputFolder sitespeed-results "${CI_ENVIRONMENT_URL}"
|
|
|
|
after_script:
|
|
|
|
- mv sitespeed-results/data/performance.json performance.json
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- sitespeed-results/
|
|
|
|
reports:
|
|
|
|
performance: performance.json
|
|
|
|
expire_in: 31d
|
|
|
|
|
|
|
|
parallel-spec-reports:
|
|
|
|
extends:
|
|
|
|
- .review:rules:mr-only-manual
|
2020-10-23 18:08:31 +00:00
|
|
|
image: ruby:2.7-alpine
|
2020-06-30 15:08:48 +00:00
|
|
|
stage: post-qa
|
|
|
|
dependencies: ["review-qa-all"]
|
|
|
|
variables:
|
|
|
|
NEW_PARALLEL_SPECS_REPORT: qa/report-new.html
|
|
|
|
BASE_ARTIFACT_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/file/qa/"
|
|
|
|
script:
|
|
|
|
- apk add --update build-base libxml2-dev libxslt-dev && rm -rf /var/cache/apk/*
|
|
|
|
- gem install nokogiri --no-document
|
|
|
|
- cd qa/gitlab-qa-run-*/gitlab-*
|
|
|
|
- ARTIFACT_DIRS=$(pwd |rev| awk -F / '{print $1,$2}' | rev | sed s_\ _/_)
|
|
|
|
- cd -
|
|
|
|
- '[[ -f $NEW_PARALLEL_SPECS_REPORT ]] || echo "{}" > ${NEW_PARALLEL_SPECS_REPORT}'
|
|
|
|
- scripts/merge-html-reports ${NEW_PARALLEL_SPECS_REPORT} ${BASE_ARTIFACT_URL}${ARTIFACT_DIRS} qa/gitlab-qa-run-*/**/rspec.htm
|
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- qa/report-new.html
|
|
|
|
- qa/gitlab-qa-run-*
|
|
|
|
reports:
|
|
|
|
junit: qa/gitlab-qa-run-*/**/rspec-*.xml
|
|
|
|
expire_in: 31d
|
2019-04-12 08:56:38 +00:00
|
|
|
|
|
|
|
danger-review:
|
2019-08-26 20:41:55 +00:00
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-05-11 15:09:37 +00:00
|
|
|
- .yarn-cache
|
2020-02-12 15:09:37 +00:00
|
|
|
- .review:rules:danger
|
2019-04-12 08:56:38 +00:00
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger
|
|
|
|
stage: test
|
2020-02-20 18:08:51 +00:00
|
|
|
needs: []
|
2019-04-12 08:56:38 +00:00
|
|
|
script:
|
2020-10-08 18:08:32 +00:00
|
|
|
- source ./scripts/utils.sh
|
|
|
|
- run_timed_command "retry yarn install --frozen-lockfile"
|
2020-03-05 18:08:19 +00:00
|
|
|
- danger --fail-on-errors=true --verbose
|