2019-08-26 16:41:55 -04:00
|
|
|
.review-docker:
|
2019-09-03 03:09:34 -04:00
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-04-08 11:09:29 -04:00
|
|
|
- .use-docker-in-docker
|
2020-02-05 07:09:15 -05:00
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.6
|
2019-08-26 16:41:55 -04:00
|
|
|
variables:
|
2019-09-16 14:06:05 -04:00
|
|
|
GITLAB_EDITION: "ce"
|
2019-04-12 04:56:38 -04:00
|
|
|
|
|
|
|
build-qa-image:
|
2020-02-12 10:09:37 -05:00
|
|
|
extends:
|
|
|
|
- .review-docker
|
2020-03-19 20:09:29 -04:00
|
|
|
- .review:rules:mr-and-schedule-auto
|
2019-09-17 10:16:34 -04:00
|
|
|
stage: prepare
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
2019-09-16 14:06:05 -04:00
|
|
|
- '[[ ! -d "ee/" ]] || export GITLAB_EDITION="ee"'
|
2019-12-20 07:07:40 -05:00
|
|
|
- export QA_MASTER_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab/gitlab-${GITLAB_EDITION}-qa:master"
|
2019-09-16 14:06:05 -04:00
|
|
|
- export QA_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab/gitlab-${GITLAB_EDITION}-qa:${CI_COMMIT_REF_SLUG}"
|
2019-12-20 07:07:40 -05:00
|
|
|
- echo "${CI_JOB_TOKEN}" | docker login --username gitlab-ci-token --password-stdin ${CI_REGISTRY}
|
2019-12-12 10:08:41 -05:00
|
|
|
- time docker pull "${QA_MASTER_IMAGE}"
|
|
|
|
- time docker build --cache-from "${QA_MASTER_IMAGE}" --tag ${QA_IMAGE} --file ./qa/Dockerfile ./
|
2019-04-12 04:56:38 -04:00
|
|
|
- time docker push ${QA_IMAGE}
|
|
|
|
|
2020-04-09 08:09:24 -04:00
|
|
|
.review-cleanup-base:
|
2019-09-18 14:06:14 -04:00
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-02-12 10:09:37 -05:00
|
|
|
- .review:rules:review-cleanup
|
2019-09-18 14:06:14 -04:00
|
|
|
stage: prepare
|
|
|
|
allow_failure: true
|
|
|
|
environment:
|
|
|
|
name: review/auto-cleanup
|
|
|
|
action: stop
|
|
|
|
before_script:
|
|
|
|
- source scripts/utils.sh
|
|
|
|
- install_gitlab_gem
|
|
|
|
script:
|
|
|
|
- ruby -rrubygems scripts/review_apps/automated_cleanup.rb
|
|
|
|
|
2020-04-09 08:09:24 -04:00
|
|
|
review-cleanup:
|
|
|
|
extends:
|
|
|
|
- .review-cleanup-base
|
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base
|
|
|
|
|
|
|
|
review-cleanup-helm3:
|
|
|
|
extends:
|
|
|
|
- .review-cleanup-base
|
|
|
|
variables:
|
|
|
|
HELM_3: 1
|
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-helm3-kubectl1.14
|
|
|
|
|
2020-03-30 23:07:51 -04:00
|
|
|
review-gcp-cleanup:
|
|
|
|
extends:
|
|
|
|
- .review:rules:review-gcp-cleanup
|
|
|
|
stage: prepare
|
|
|
|
image: gcr.io/google.com/cloudsdktool/cloud-sdk:latest
|
|
|
|
allow_failure: true
|
|
|
|
environment:
|
|
|
|
name: review/auto-gcp-cleanup
|
|
|
|
action: stop
|
|
|
|
before_script:
|
|
|
|
- gcloud auth activate-service-account --key-file=$REVIEW_APPS_GCP_CREDENTIALS
|
|
|
|
- gcloud config set project $REVIEW_APPS_GCP_PROJECT
|
|
|
|
- apt-get install -y jq
|
|
|
|
- source scripts/review_apps/gcp_cleanup.sh
|
|
|
|
script:
|
|
|
|
- gcp_cleanup
|
|
|
|
|
2020-02-12 10:09:37 -05:00
|
|
|
review-build-cng:
|
2019-09-17 10:16:34 -04:00
|
|
|
extends:
|
2019-10-31 02:06:31 -04:00
|
|
|
- .default-retry
|
2020-03-19 20:09:29 -04:00
|
|
|
- .review:rules:mr-and-schedule-auto-if-frontend-manual-otherwise
|
2019-05-06 06:35:35 -04:00
|
|
|
image: ruby:2.6-alpine
|
2019-08-28 17:07:54 -04:00
|
|
|
stage: review-prepare
|
2019-04-18 15:18:20 -04:00
|
|
|
before_script:
|
|
|
|
- source scripts/utils.sh
|
|
|
|
- install_api_client_dependencies_with_apk
|
|
|
|
- install_gitlab_gem
|
2020-02-12 10:09:37 -05:00
|
|
|
needs:
|
|
|
|
- job: gitlab:assets:compile pull-cache
|
|
|
|
artifacts: false
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
|
|
|
- BUILD_TRIGGER_TOKEN=$REVIEW_APPS_BUILD_TRIGGER_TOKEN ./scripts/trigger-build cng
|
2020-03-19 20:09:29 -04:00
|
|
|
# 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.
|
|
|
|
- '[ -z $CI_JOB_MANUAL ] || play_job "review-deploy"'
|
2019-04-12 04:56:38 -04:00
|
|
|
|
2019-10-31 02:06:31 -04:00
|
|
|
.review-workflow-base:
|
2019-09-18 14:06:14 -04:00
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-04-07 14:09:19 -04:00
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-helm3-kubectl1.14
|
2019-04-12 04:56:38 -04:00
|
|
|
variables:
|
|
|
|
HOST_SUFFIX: "${CI_ENVIRONMENT_SLUG}"
|
|
|
|
DOMAIN: "-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}"
|
2020-04-01 11:07:45 -04:00
|
|
|
GITLAB_HELM_CHART_REF: "v3.2.2"
|
2019-09-16 14:06:05 -04:00
|
|
|
GITLAB_EDITION: "ce"
|
2019-08-26 16:41:55 -04:00
|
|
|
environment:
|
2019-04-18 15:18:20 -04:00
|
|
|
name: review/${CI_COMMIT_REF_NAME}
|
|
|
|
url: https://gitlab-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}
|
2019-04-12 04:56:38 -04:00
|
|
|
on_stop: review-stop
|
2020-03-04 16:07:54 -05:00
|
|
|
auto_stop_in: 48 hours
|
2019-10-31 02:06:31 -04:00
|
|
|
|
2020-02-12 10:09:37 -05:00
|
|
|
review-deploy:
|
|
|
|
extends:
|
|
|
|
- .review-workflow-base
|
2020-03-19 20:09:29 -04:00
|
|
|
- .review:rules:mr-and-schedule-auto-if-frontend-manual-otherwise
|
2019-10-31 02:06:31 -04:00
|
|
|
stage: review
|
2020-03-19 20:09:29 -04:00
|
|
|
dependencies: []
|
2020-03-09 11:07:45 -04:00
|
|
|
resource_group: "review/${CI_COMMIT_REF_NAME}"
|
2019-10-31 02:06:31 -04:00
|
|
|
allow_failure: true
|
2019-04-12 04:56:38 -04:00
|
|
|
before_script:
|
2019-09-16 14:06:05 -04:00
|
|
|
- '[[ ! -d "ee/" ]] || export GITLAB_EDITION="ee"'
|
2019-04-12 04:56:38 -04:00
|
|
|
- export GITLAB_SHELL_VERSION=$(<GITLAB_SHELL_VERSION)
|
|
|
|
- export GITALY_VERSION=$(<GITALY_SERVER_VERSION)
|
|
|
|
- export GITLAB_WORKHORSE_VERSION=$(<GITLAB_WORKHORSE_VERSION)
|
2020-02-13 10:08:52 -05:00
|
|
|
- echo "${CI_ENVIRONMENT_URL}" > environment_url.txt
|
2020-02-12 10:09:37 -05:00
|
|
|
- source ./scripts/utils.sh
|
2019-04-18 15:18:20 -04:00
|
|
|
- install_api_client_dependencies_with_apk
|
|
|
|
- source scripts/review_apps/review-apps.sh
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
2019-05-23 10:37:29 -04:00
|
|
|
- check_kube_domain
|
|
|
|
- ensure_namespace
|
|
|
|
- install_external_dns
|
|
|
|
- download_chart
|
2019-10-14 11:06:07 -04:00
|
|
|
- date
|
2019-07-30 11:33:00 -04:00
|
|
|
- deploy || (display_deployment_debug && exit 1)
|
2020-03-19 20:09:29 -04: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.
|
|
|
|
- '[ -z $CI_JOB_MANUAL ] || play_job "review-qa-smoke"'
|
|
|
|
- '[ -z $CI_JOB_MANUAL ] || play_job "review-performance"'
|
2019-04-18 15:18:20 -04:00
|
|
|
artifacts:
|
2020-02-13 10:08:52 -05:00
|
|
|
paths: [environment_url.txt]
|
2019-04-18 15:18:20 -04:00
|
|
|
expire_in: 2 days
|
|
|
|
when: always
|
2019-04-12 04:56:38 -04:00
|
|
|
|
2020-02-12 10:09:37 -05:00
|
|
|
.review-stop-base:
|
2019-12-27 07:07:59 -05:00
|
|
|
extends: .review-workflow-base
|
2019-04-18 15:18:20 -04:00
|
|
|
environment:
|
|
|
|
action: stop
|
2020-02-17 10:09:01 -05:00
|
|
|
dependencies: []
|
2019-08-26 16:41:55 -04:00
|
|
|
variables:
|
2019-12-27 13:08:12 -05: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 16:41:55 -04:00
|
|
|
before_script:
|
|
|
|
- apk add --update openssl
|
2019-12-27 13:08:12 -05:00
|
|
|
- source ./scripts/utils.sh
|
|
|
|
- source ./scripts/review_apps/review-apps.sh
|
2019-04-18 15:18:20 -04:00
|
|
|
|
2019-11-01 14:06:00 -04:00
|
|
|
review-stop-failed-deployment:
|
2020-02-12 10:09:37 -05:00
|
|
|
extends:
|
|
|
|
- .review-stop-base
|
|
|
|
- .review:rules:mr-only-auto
|
2019-09-09 15:29:44 -04:00
|
|
|
stage: prepare
|
|
|
|
script:
|
|
|
|
- delete_failed_release
|
2020-04-07 14:09:19 -04:00
|
|
|
- delete_helm2_release
|
2019-09-09 15:29:44 -04:00
|
|
|
|
2019-10-31 02:06:31 -04:00
|
|
|
review-stop:
|
2020-02-12 10:09:37 -05:00
|
|
|
extends:
|
|
|
|
- .review-stop-base
|
|
|
|
- .review:rules:mr-only-manual
|
2019-11-01 14:06:00 -04:00
|
|
|
stage: review
|
2019-10-31 02:06:31 -04:00
|
|
|
allow_failure: true
|
|
|
|
script:
|
|
|
|
- delete_release
|
|
|
|
|
2019-08-26 16:41:55 -04:00
|
|
|
.review-qa-base:
|
2019-12-23 16:07:52 -05:00
|
|
|
extends: .review-docker
|
2019-04-18 15:18:20 -04:00
|
|
|
stage: qa
|
2020-03-19 20:09:29 -04:00
|
|
|
# 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"]
|
2019-09-18 14:06:14 -04:00
|
|
|
allow_failure: true
|
2019-04-12 04:56:38 -04:00
|
|
|
variables:
|
|
|
|
QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa"
|
|
|
|
QA_CAN_TEST_GIT_PROTOCOL_V2: "false"
|
2019-08-26 16:41:55 -04:00
|
|
|
QA_DEBUG: "true"
|
2019-04-12 04:56:38 -04:00
|
|
|
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}"
|
|
|
|
before_script:
|
2019-09-16 14:06:05 -04:00
|
|
|
- '[[ ! -d "ee/" ]] || export GITLAB_EDITION="ee"'
|
|
|
|
- export QA_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab/gitlab-${GITLAB_EDITION}-qa:${CI_COMMIT_REF_SLUG}"
|
2020-02-13 10:08:52 -05:00
|
|
|
- export CI_ENVIRONMENT_URL="$(cat environment_url.txt)"
|
2019-04-12 04:56:38 -04:00
|
|
|
- echo "${CI_ENVIRONMENT_URL}"
|
2019-04-18 15:18:20 -04:00
|
|
|
- echo "${QA_IMAGE}"
|
|
|
|
- source scripts/utils.sh
|
|
|
|
- install_api_client_dependencies_with_apk
|
2019-04-12 04:56:38 -04:00
|
|
|
- gem install gitlab-qa --no-document ${GITLAB_QA_VERSION:+ --version ${GITLAB_QA_VERSION}}
|
2019-12-23 16:07:52 -05:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- ./qa/gitlab-qa-run-*
|
|
|
|
expire_in: 7 days
|
|
|
|
when: always
|
2019-04-12 04:56:38 -04:00
|
|
|
|
|
|
|
review-qa-smoke:
|
2020-02-12 10:09:37 -05:00
|
|
|
extends:
|
|
|
|
- .review-qa-base
|
2020-03-19 20:09:29 -04:00
|
|
|
- .review:rules:mr-only-auto-if-frontend-manual-otherwise
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
|
|
|
- gitlab-qa Test::Instance::Smoke "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}"
|
|
|
|
|
|
|
|
review-qa-all:
|
2020-02-12 10:09:37 -05:00
|
|
|
extends:
|
|
|
|
- .review-qa-base
|
|
|
|
- .review:rules:mr-only-manual
|
2019-06-03 06:37:43 -04:00
|
|
|
parallel: 5
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
2019-09-30 08:06:01 -04:00
|
|
|
- export KNAPSACK_REPORT_PATH=knapsack/master_report.json
|
2019-06-03 06:37:43 -04:00
|
|
|
- export KNAPSACK_TEST_FILE_PATTERN=qa/specs/features/**/*_spec.rb
|
2019-06-07 08:46:48 -04:00
|
|
|
- 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
|
|
|
|
|
2020-02-12 10:09:37 -05:00
|
|
|
review-performance:
|
|
|
|
extends:
|
2020-04-07 14:09:19 -04:00
|
|
|
- .default-retry
|
2020-03-19 20:09:29 -04:00
|
|
|
- .review:rules:mr-and-schedule-auto-if-frontend-manual-otherwise
|
2020-04-07 14:09:19 -04:00
|
|
|
image:
|
|
|
|
name: sitespeedio/sitespeed.io:6.3.1
|
|
|
|
entrypoint: [""]
|
2019-09-18 14:06:14 -04:00
|
|
|
stage: qa
|
2020-03-19 20:09:29 -04:00
|
|
|
# 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"]
|
2019-06-07 08:46:48 -04:00
|
|
|
allow_failure: true
|
2019-09-18 14:06:14 -04:00
|
|
|
before_script:
|
2020-02-13 10:08:52 -05:00
|
|
|
- export CI_ENVIRONMENT_URL="$(cat environment_url.txt)"
|
2019-09-18 14:06:14 -04:00
|
|
|
- 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:
|
2020-04-07 14:09:19 -04:00
|
|
|
- /start.sh --plugins.add ./gitlab-exporter --outputFolder sitespeed-results "${CI_ENVIRONMENT_URL}"
|
2019-09-18 14:06:14 -04:00
|
|
|
after_script:
|
|
|
|
- mv sitespeed-results/data/performance.json performance.json
|
2019-06-07 08:46:48 -04:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2019-09-18 14:06:14 -04:00
|
|
|
- sitespeed-results/
|
2019-06-07 08:46:48 -04:00
|
|
|
reports:
|
2019-09-18 14:06:14 -04:00
|
|
|
performance: performance.json
|
2019-04-12 04:56:38 -04:00
|
|
|
|
2019-09-18 14:06:14 -04:00
|
|
|
parallel-spec-reports:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends:
|
2020-02-12 10:09:37 -05:00
|
|
|
- .review:rules:mr-only-manual
|
2019-09-18 14:06:14 -04:00
|
|
|
image: ruby:2.6-alpine
|
2019-11-29 10:06:43 -05:00
|
|
|
stage: post-qa
|
2019-09-18 14:06:14 -04:00
|
|
|
dependencies: ["review-qa-all"]
|
2020-02-12 10:09:37 -05:00
|
|
|
allow_failure: true
|
2019-09-18 14:06:14 -04:00
|
|
|
variables:
|
|
|
|
NEW_PARALLEL_SPECS_REPORT: qa/report-new.html
|
|
|
|
BASE_ARTIFACT_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/file/qa/"
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
2019-09-18 14:06:14 -04:00
|
|
|
- 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
|
2020-02-12 10:09:37 -05:00
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- qa/report-new.html
|
|
|
|
- qa/gitlab-qa-run-*
|
|
|
|
reports:
|
|
|
|
junit: qa/gitlab-qa-run-*/**/rspec-*.xml
|
2019-04-12 04:56:38 -04:00
|
|
|
|
|
|
|
danger-review:
|
2019-08-26 16:41:55 -04:00
|
|
|
extends:
|
|
|
|
- .default-retry
|
|
|
|
- .default-cache
|
2020-02-12 10:09:37 -05:00
|
|
|
- .review:rules:danger
|
2019-04-12 04:56:38 -04:00
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger
|
|
|
|
stage: test
|
2020-02-20 13:08:51 -05:00
|
|
|
needs: []
|
2019-04-12 04:56:38 -04:00
|
|
|
script:
|
|
|
|
- git version
|
|
|
|
- node --version
|
2019-07-02 10:29:47 -04:00
|
|
|
- yarn install --frozen-lockfile --cache-folder .yarn-cache --prefer-offline
|
2020-03-05 13:08:19 -05:00
|
|
|
- danger --fail-on-errors=true --verbose
|