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
|
2021-07-22 05:08:22 -04:00
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-helm3-kubectl1.14
|
2019-09-18 14:06:14 -04:00
|
|
|
stage: prepare
|
|
|
|
environment:
|
|
|
|
name: review/auto-cleanup
|
|
|
|
action: stop
|
|
|
|
before_script:
|
|
|
|
- source scripts/utils.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:
|
|
|
|
- ruby -rrubygems scripts/review_apps/automated_cleanup.rb
|
2020-03-30 23:07:51 -04:00
|
|
|
- gcp_cleanup
|
|
|
|
|
2020-10-08 14:08:32 -04: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 11:08:48 -04:00
|
|
|
review-build-cng:
|
|
|
|
extends:
|
|
|
|
- .default-retry
|
|
|
|
- .review:rules:review-build-cng
|
2021-07-14 11:09:57 -04:00
|
|
|
image: ${GITLAB_DEPENDENCY_PROXY}ruby:2.7-alpine3.13
|
2020-06-30 11:08:48 -04:00
|
|
|
stage: review-prepare
|
|
|
|
needs:
|
|
|
|
- job: compile-production-assets
|
|
|
|
artifacts: false
|
2021-07-27 11:09:49 -04:00
|
|
|
variables:
|
|
|
|
CNG_PROJECT_ACCESS_TOKEN: "${CNG_MIRROR_PROJECT_ACCESS_TOKEN}" # "Multi-pipeline (from 'gitlab-org/gitlab' 'review-build-cng' job)" at https://gitlab.com/gitlab-org/build/CNG-mirror/-/settings/access_tokens
|
|
|
|
CNG_PROJECT_PATH: "gitlab-org/build/CNG-mirror"
|
|
|
|
before_script:
|
|
|
|
- source ./scripts/utils.sh
|
|
|
|
- install_gitlab_gem
|
2020-06-30 11:08:48 -04:00
|
|
|
script:
|
2021-05-17 08:10:23 -04:00
|
|
|
- ./scripts/trigger-build cng
|
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
|
2021-05-25 11:10:33 -04:00
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-helm3.5-kubectl1.17
|
2019-04-12 04:56:38 -04:00
|
|
|
variables:
|
|
|
|
HOST_SUFFIX: "${CI_ENVIRONMENT_SLUG}"
|
|
|
|
DOMAIN: "-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}"
|
2021-07-29 08:08:55 -04:00
|
|
|
GITLAB_HELM_CHART_REF: "v5.1.0"
|
2019-08-26 16:41:55 -04:00
|
|
|
environment:
|
2020-09-01 14:10:48 -04:00
|
|
|
name: review/${CI_COMMIT_REF_SLUG}${FREQUENCY}
|
2019-04-18 15:18:20 -04:00
|
|
|
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-06-30 11:08:48 -04:00
|
|
|
review-deploy:
|
|
|
|
extends:
|
|
|
|
- .review-workflow-base
|
2020-08-27 11:10:21 -04:00
|
|
|
- .review:rules:review-deploy
|
2020-06-30 11:08:48 -04:00
|
|
|
stage: review
|
2021-04-28 08:10:09 -04:00
|
|
|
needs: ["review-build-cng"]
|
2020-06-30 11:08:48 -04:00
|
|
|
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 14:08:32 -04:00
|
|
|
- *base-before_script
|
2020-06-30 11:08:48 -04:00
|
|
|
script:
|
|
|
|
- check_kube_domain
|
|
|
|
- download_chart
|
|
|
|
- date
|
|
|
|
- deploy || (display_deployment_debug && exit 1)
|
2021-06-09 05:10:18 -04:00
|
|
|
- verify_deploy || exit 1
|
2020-10-05 08:08:47 -04:00
|
|
|
- disable_sign_ups || (delete_release && exit 1)
|
2020-08-24 14:10:19 -04: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 11:08:48 -04:00
|
|
|
artifacts:
|
2021-06-09 05:10:18 -04:00
|
|
|
paths:
|
|
|
|
- environment_url.txt
|
|
|
|
- curl_output.txt
|
2020-10-06 14:08:49 -04:00
|
|
|
expire_in: 7 days
|
2020-06-30 11:08:48 -04:00
|
|
|
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:
|
2020-10-08 14:08:32 -04:00
|
|
|
- *base-before_script
|
2019-04-18 15:18:20 -04:00
|
|
|
|
2021-07-09 08:08:17 -04:00
|
|
|
review-delete-deployment:
|
2020-02-12 10:09:37 -05:00
|
|
|
extends:
|
|
|
|
- .review-stop-base
|
2021-07-09 08:08:17 -04:00
|
|
|
- .review:rules:review-delete-deployment
|
2019-09-09 15:29:44 -04:00
|
|
|
stage: prepare
|
|
|
|
script:
|
2021-07-09 08:08:17 -04:00
|
|
|
- delete_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
|
2020-09-01 14:10:48 -04:00
|
|
|
- .review:rules:review-stop
|
|
|
|
stage: post-qa
|
2019-10-31 02:06:31 -04:00
|
|
|
script:
|
2021-07-09 08:08:17 -04:00
|
|
|
- delete_k8s_release_namespace
|
2019-10-31 02:06:31 -04:00
|
|
|
|
2020-06-30 11:08:48 -04:00
|
|
|
.review-qa-base:
|
|
|
|
extends:
|
|
|
|
- .use-docker-in-docker
|
2021-06-21 14:08:00 -04:00
|
|
|
image:
|
2021-07-21 14:09:27 -04:00
|
|
|
name: ${QA_IMAGE}
|
2021-06-21 14:08:00 -04:00
|
|
|
entrypoint: [""]
|
2020-06-30 11:08:48 -04:00
|
|
|
stage: qa
|
2021-06-21 14:08:00 -04:00
|
|
|
needs: ["build-qa-image", "review-deploy"]
|
2020-06-30 11:08:48 -04:00
|
|
|
variables:
|
|
|
|
QA_DEBUG: "true"
|
2021-06-21 14:08:00 -04:00
|
|
|
QA_CAN_TEST_GIT_PROTOCOL_V2: "false"
|
2021-05-26 17:10:49 -04:00
|
|
|
QA_GENERATE_ALLURE_REPORT: "true"
|
2020-06-30 11:08:48 -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}"
|
|
|
|
SIGNUP_DISABLED: "true"
|
|
|
|
before_script:
|
2021-06-21 14:08:00 -04:00
|
|
|
# Use $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA so that GitLab image built in omnibus-gitlab-mirror and QA image are in sync.
|
|
|
|
- if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA" ]; then
|
|
|
|
git checkout -f ${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA};
|
|
|
|
fi
|
2020-06-30 11:08:48 -04:00
|
|
|
- export CI_ENVIRONMENT_URL="$(cat environment_url.txt)"
|
|
|
|
- echo "${CI_ENVIRONMENT_URL}"
|
2021-06-21 14:08:00 -04:00
|
|
|
- cd qa
|
2020-06-30 11:08:48 -04:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2021-06-21 14:08:00 -04:00
|
|
|
- qa/tmp
|
2020-06-30 11:08:48 -04:00
|
|
|
expire_in: 7 days
|
|
|
|
when: always
|
|
|
|
|
2021-05-26 17:10:49 -04:00
|
|
|
.allure-report-base:
|
|
|
|
image:
|
2021-06-21 11:07:30 -04:00
|
|
|
name: ${GITLAB_DEPENDENCY_PROXY}andrcuns/allure-report-publisher:0.3.4
|
2021-05-26 17:10:49 -04:00
|
|
|
entrypoint: [""]
|
|
|
|
stage: post-qa
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
STORAGE_CREDENTIALS: $QA_ALLURE_REPORT_GCS_CREDENTIALS
|
2021-06-01 08:09:36 -04:00
|
|
|
GITLAB_AUTH_TOKEN: $GITLAB_QA_MR_ALLURE_REPORT_TOKEN
|
2021-06-03 08:10:18 -04:00
|
|
|
allow_failure: true
|
2021-05-26 17:10:49 -04:00
|
|
|
script:
|
|
|
|
- |
|
|
|
|
allure-report-publisher upload gcs \
|
2021-06-21 14:08:00 -04:00
|
|
|
--results-glob="qa/tmp/allure-results/*" \
|
2021-05-26 17:10:49 -04:00
|
|
|
--bucket="gitlab-qa-allure-reports" \
|
|
|
|
--prefix="$ALLURE_REPORT_PATH_PREFIX/$CI_COMMIT_REF_SLUG" \
|
2021-06-01 08:09:36 -04:00
|
|
|
--update-pr="comment" \
|
2021-05-26 17:10:49 -04:00
|
|
|
--copy-latest \
|
2021-06-14 02:10:18 -04:00
|
|
|
--ignore-missing-results \
|
2021-05-26 17:10:49 -04:00
|
|
|
--color
|
|
|
|
|
2020-06-30 11:08:48 -04:00
|
|
|
review-qa-smoke:
|
|
|
|
extends:
|
|
|
|
- .review-qa-base
|
|
|
|
- .review:rules:review-qa-smoke
|
2021-06-02 05:09:46 -04:00
|
|
|
retry: 1 # This is confusing but this means "2 runs at max".
|
2020-06-30 11:08:48 -04:00
|
|
|
script:
|
2021-06-21 14:08:00 -04:00
|
|
|
- bin/test Test::Instance::Smoke "${CI_ENVIRONMENT_URL}"
|
2020-06-30 11:08:48 -04:00
|
|
|
|
|
|
|
review-qa-all:
|
|
|
|
extends:
|
|
|
|
- .review-qa-base
|
2021-03-22 05:09:15 -04:00
|
|
|
- .review:rules:review-qa-all
|
2020-06-30 11:08:48 -04:00
|
|
|
parallel: 5
|
|
|
|
script:
|
|
|
|
- export KNAPSACK_REPORT_PATH=knapsack/master_report.json
|
|
|
|
- export KNAPSACK_TEST_FILE_PATTERN=qa/specs/features/**/*_spec.rb
|
2021-06-21 14:08:00 -04:00
|
|
|
- |
|
|
|
|
bin/test Test::Instance::All "${CI_ENVIRONMENT_URL}" \
|
|
|
|
-- \
|
|
|
|
--color --format documentation \
|
|
|
|
--format RspecJunitFormatter --out tmp/rspec.xml
|
|
|
|
artifacts:
|
|
|
|
reports:
|
|
|
|
junit: qa/tmp/rspec.xml
|
2020-06-30 11:08:48 -04:00
|
|
|
|
|
|
|
review-performance:
|
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-08-27 11:10:21 -04:00
|
|
|
- .review:rules:review-performance
|
2020-06-30 11:08:48 -04:00
|
|
|
image:
|
2020-09-18 14:10:26 -04:00
|
|
|
name: sitespeedio/sitespeed.io
|
2020-06-30 11:08:48 -04:00
|
|
|
entrypoint: [""]
|
|
|
|
stage: qa
|
2021-04-28 08:10:09 -04:00
|
|
|
needs: ["review-deploy"]
|
2020-06-30 11:08:48 -04:00
|
|
|
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
|
|
|
|
|
2021-05-26 17:10:49 -04:00
|
|
|
allure-report-qa-smoke:
|
|
|
|
extends:
|
|
|
|
- .allure-report-base
|
2021-06-01 08:09:36 -04:00
|
|
|
- .review:rules:review-qa-smoke-report
|
2021-05-26 17:10:49 -04:00
|
|
|
needs: ["review-qa-smoke"]
|
|
|
|
variables:
|
|
|
|
ALLURE_REPORT_PATH_PREFIX: gitlab-review-smoke
|
2021-06-01 08:09:36 -04:00
|
|
|
ALLURE_JOB_NAME: review-qa-smoke
|
2021-05-26 17:10:49 -04:00
|
|
|
|
|
|
|
allure-report-qa-all:
|
|
|
|
extends:
|
|
|
|
- .allure-report-base
|
2021-06-01 08:09:36 -04:00
|
|
|
- .review:rules:review-qa-all-report
|
2021-05-26 17:10:49 -04:00
|
|
|
needs: ["review-qa-all"]
|
|
|
|
variables:
|
|
|
|
ALLURE_REPORT_PATH_PREFIX: gitlab-review-all
|
2021-06-01 08:09:36 -04:00
|
|
|
ALLURE_JOB_NAME: review-qa-all
|
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
|
|
|
|
run_timed_command "bundle exec danger --fail-on-errors=true --verbose"
|
|
|
|
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
|