2019-04-12 08:56:38 +00:00
|
|
|
.review-only: &review-only
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- branches@gitlab-org/gitlab-ce
|
|
|
|
- branches@gitlab-org/gitlab-ee
|
|
|
|
kubernetes: active
|
|
|
|
except:
|
|
|
|
refs:
|
|
|
|
- master
|
2019-08-05 22:55:21 +00:00
|
|
|
- /^\d+-\d+-auto-deploy-\d+$/
|
2019-08-02 06:24:07 +00:00
|
|
|
- /(^docs[\/-].+|.+-docs$)/
|
2019-04-12 08:56:38 +00:00
|
|
|
|
|
|
|
.review-schedules-only: &review-schedules-only
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- schedules@gitlab-org/gitlab-ce
|
|
|
|
- schedules@gitlab-org/gitlab-ee
|
|
|
|
kubernetes: active
|
|
|
|
variables:
|
|
|
|
- $REVIEW_APP_CLEANUP
|
|
|
|
except:
|
|
|
|
refs:
|
|
|
|
- tags
|
2019-08-02 06:24:07 +00:00
|
|
|
- /(^docs[\/-].+|.+-docs$)/
|
2019-04-12 08:56:38 +00:00
|
|
|
|
|
|
|
.review-base: &review-base
|
|
|
|
extends: .dedicated-runner
|
|
|
|
<<: *review-only
|
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base
|
|
|
|
cache: {}
|
|
|
|
dependencies: []
|
2019-04-18 19:18:20 +00:00
|
|
|
before_script:
|
|
|
|
- source scripts/utils.sh
|
2019-04-12 08:56:38 +00:00
|
|
|
|
|
|
|
.review-docker: &review-docker
|
|
|
|
<<: *review-base
|
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine
|
|
|
|
services:
|
2019-08-02 12:46:06 +00:00
|
|
|
- docker:19.03.0-dind
|
2019-04-12 08:56:38 +00:00
|
|
|
tags:
|
|
|
|
- gitlab-org
|
|
|
|
- docker
|
|
|
|
variables: &review-docker-variables
|
|
|
|
DOCKER_DRIVER: overlay2
|
|
|
|
DOCKER_HOST: tcp://docker:2375
|
|
|
|
LATEST_QA_IMAGE: "gitlab/${CI_PROJECT_NAME}-qa:nightly"
|
|
|
|
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab/${CI_PROJECT_NAME}-qa:${CI_COMMIT_REF_SLUG}"
|
|
|
|
|
|
|
|
build-qa-image:
|
|
|
|
<<: *review-docker
|
2019-05-06 11:44:51 +00:00
|
|
|
stage: test
|
2019-04-12 08:56:38 +00:00
|
|
|
script:
|
|
|
|
- time docker build --cache-from ${LATEST_QA_IMAGE} --tag ${QA_IMAGE} ./qa/
|
|
|
|
- echo "${CI_JOB_TOKEN}" | docker login --username gitlab-ci-token --password-stdin ${CI_REGISTRY}
|
|
|
|
- time docker push ${QA_IMAGE}
|
|
|
|
|
|
|
|
.review-build-cng-base: &review-build-cng-base
|
2019-05-06 10:35:35 +00:00
|
|
|
image: ruby:2.6-alpine
|
2019-04-12 08:56:38 +00:00
|
|
|
stage: test
|
2019-04-18 19:18:20 +00:00
|
|
|
when: manual
|
|
|
|
before_script:
|
|
|
|
- source scripts/utils.sh
|
|
|
|
- install_api_client_dependencies_with_apk
|
|
|
|
- install_gitlab_gem
|
2019-04-12 08:56:38 +00:00
|
|
|
dependencies: []
|
|
|
|
cache: {}
|
|
|
|
script:
|
|
|
|
- BUILD_TRIGGER_TOKEN=$REVIEW_APPS_BUILD_TRIGGER_TOKEN ./scripts/trigger-build cng
|
|
|
|
|
|
|
|
review-build-cng:
|
|
|
|
<<: *review-only
|
|
|
|
<<: *review-build-cng-base
|
|
|
|
|
|
|
|
schedule:review-build-cng:
|
|
|
|
<<: *review-schedules-only
|
|
|
|
<<: *review-build-cng-base
|
|
|
|
|
|
|
|
.review-deploy-base: &review-deploy-base
|
|
|
|
<<: *review-base
|
2019-06-05 14:29:46 +00:00
|
|
|
allow_failure: true
|
2019-06-28 07:18:28 +00:00
|
|
|
retry: 1
|
2019-04-18 19:18:20 +00:00
|
|
|
stage: review
|
2019-04-12 08:56:38 +00:00
|
|
|
variables:
|
|
|
|
HOST_SUFFIX: "${CI_ENVIRONMENT_SLUG}"
|
|
|
|
DOMAIN: "-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}"
|
|
|
|
GITLAB_HELM_CHART_REF: "master"
|
2019-04-18 19:18:20 +00:00
|
|
|
environment: &review-environment
|
|
|
|
name: review/${CI_COMMIT_REF_NAME}
|
|
|
|
url: https://gitlab-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}
|
2019-04-12 08:56:38 +00:00
|
|
|
on_stop: review-stop
|
|
|
|
before_script:
|
|
|
|
- export GITLAB_SHELL_VERSION=$(<GITLAB_SHELL_VERSION)
|
|
|
|
- export GITALY_VERSION=$(<GITALY_SERVER_VERSION)
|
|
|
|
- export GITLAB_WORKHORSE_VERSION=$(<GITLAB_WORKHORSE_VERSION)
|
2019-04-18 19:18:20 +00:00
|
|
|
- echo "${CI_ENVIRONMENT_URL}" > review_app_url.txt
|
|
|
|
- source scripts/utils.sh
|
|
|
|
- install_api_client_dependencies_with_apk
|
|
|
|
- source scripts/review_apps/review-apps.sh
|
2019-04-12 08:56:38 +00:00
|
|
|
script:
|
2019-05-23 14:37:29 +00:00
|
|
|
- check_kube_domain
|
|
|
|
- ensure_namespace
|
|
|
|
- install_tiller
|
|
|
|
- install_external_dns
|
|
|
|
- download_chart
|
2019-07-30 15:33:00 +00:00
|
|
|
- deploy || (display_deployment_debug && exit 1)
|
2019-05-23 14:37:29 +00:00
|
|
|
- add_license
|
2019-04-18 19:18:20 +00:00
|
|
|
artifacts:
|
2019-05-23 14:37:29 +00:00
|
|
|
paths: [review_app_url.txt]
|
2019-04-18 19:18:20 +00:00
|
|
|
expire_in: 2 days
|
|
|
|
when: always
|
2019-04-12 08:56:38 +00:00
|
|
|
|
|
|
|
review-deploy:
|
|
|
|
<<: *review-deploy-base
|
|
|
|
|
|
|
|
schedule:review-deploy:
|
|
|
|
<<: *review-deploy-base
|
|
|
|
<<: *review-schedules-only
|
|
|
|
|
2019-04-18 19:18:20 +00:00
|
|
|
review-stop:
|
2019-07-30 11:49:41 +00:00
|
|
|
<<: *review-only
|
|
|
|
extends: .single-script-job-dedicated-runner
|
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base
|
2019-04-18 19:18:20 +00:00
|
|
|
stage: review
|
|
|
|
when: manual
|
|
|
|
allow_failure: true
|
|
|
|
variables:
|
2019-07-30 11:49:41 +00:00
|
|
|
SCRIPT_NAME: review_apps/review-apps.sh
|
2019-04-18 19:18:20 +00:00
|
|
|
environment:
|
|
|
|
<<: *review-environment
|
|
|
|
action: stop
|
|
|
|
script:
|
2019-07-30 11:49:41 +00:00
|
|
|
- wget $CI_PROJECT_URL/raw/$CI_COMMIT_SHA/scripts/utils.sh
|
|
|
|
- source utils.sh
|
|
|
|
- source $(basename $SCRIPT_NAME)
|
2019-04-18 19:18:20 +00:00
|
|
|
- delete
|
|
|
|
|
2019-04-12 08:56:38 +00:00
|
|
|
.review-qa-base: &review-qa-base
|
|
|
|
<<: *review-docker
|
2019-06-05 14:29:46 +00:00
|
|
|
allow_failure: true
|
2019-06-19 07:07:43 +00:00
|
|
|
retry: 2
|
2019-04-18 19:18:20 +00:00
|
|
|
stage: qa
|
2019-04-12 08:56:38 +00:00
|
|
|
variables:
|
|
|
|
<<: *review-docker-variables
|
|
|
|
QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa"
|
|
|
|
QA_CAN_TEST_GIT_PROTOCOL_V2: "false"
|
|
|
|
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}"
|
|
|
|
QA_DEBUG: "true"
|
2019-04-18 19:18:20 +00:00
|
|
|
dependencies:
|
|
|
|
- review-deploy
|
2019-04-12 08:56:38 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- ./qa/gitlab-qa-run-*
|
|
|
|
expire_in: 7 days
|
|
|
|
when: always
|
|
|
|
before_script:
|
2019-04-18 19:18:20 +00:00
|
|
|
- export CI_ENVIRONMENT_URL="$(cat review_app_url.txt)"
|
2019-04-12 08:56:38 +00:00
|
|
|
- echo "${CI_ENVIRONMENT_URL}"
|
2019-04-18 19:18:20 +00:00
|
|
|
- echo "${QA_IMAGE}"
|
|
|
|
- source scripts/utils.sh
|
|
|
|
- install_api_client_dependencies_with_apk
|
2019-04-12 08:56:38 +00:00
|
|
|
- gem install gitlab-qa --no-document ${GITLAB_QA_VERSION:+ --version ${GITLAB_QA_VERSION}}
|
|
|
|
|
|
|
|
review-qa-smoke:
|
|
|
|
<<: *review-qa-base
|
|
|
|
script:
|
|
|
|
- gitlab-qa Test::Instance::Smoke "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}"
|
|
|
|
|
|
|
|
review-qa-all:
|
|
|
|
<<: *review-qa-base
|
2019-05-14 16:41:56 +00:00
|
|
|
allow_failure: true
|
2019-04-18 19:18:20 +00:00
|
|
|
when: manual
|
2019-06-03 10:37:43 +00:00
|
|
|
parallel: 5
|
2019-04-12 08:56:38 +00:00
|
|
|
script:
|
2019-06-03 10:37:43 +00:00
|
|
|
- export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/review-qa-all_master_report.json
|
|
|
|
- export KNAPSACK_TEST_FILE_PATTERN=qa/specs/features/**/*_spec.rb
|
2019-06-07 12:46:48 +00: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
|
|
|
|
|
|
|
|
parallel-spec-reports:
|
|
|
|
extends: .dedicated-runner
|
|
|
|
dependencies:
|
|
|
|
- review-qa-all
|
|
|
|
image: ruby:2.6-alpine
|
|
|
|
services: []
|
|
|
|
before_script: []
|
|
|
|
variables:
|
|
|
|
SETUP_DB: "false"
|
|
|
|
NEW_PARALLEL_SPECS_REPORT: qa/report-new.html
|
|
|
|
BASE_ARTIFACT_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/file/qa/"
|
|
|
|
stage: post-test
|
|
|
|
allow_failure: true
|
|
|
|
when: manual
|
|
|
|
retry: 0
|
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
paths:
|
|
|
|
- qa/report-new.html
|
|
|
|
- qa/gitlab-qa-run-*
|
|
|
|
reports:
|
|
|
|
junit: qa/gitlab-qa-run-*/**/rspec-*.xml
|
|
|
|
script:
|
|
|
|
- apk add --update build-base libxml2-dev libxslt-dev && rm -rf /var/cache/apk/*
|
|
|
|
- gem install nokogiri
|
|
|
|
- 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
|
2019-04-12 08:56:38 +00:00
|
|
|
|
|
|
|
.review-performance-base: &review-performance-base
|
|
|
|
<<: *review-qa-base
|
2019-05-14 16:41:56 +00:00
|
|
|
allow_failure: true
|
2019-04-18 19:18:20 +00:00
|
|
|
before_script:
|
|
|
|
- export CI_ENVIRONMENT_URL="$(cat review_app_url.txt)"
|
|
|
|
- echo "${CI_ENVIRONMENT_URL}"
|
2019-04-12 08:56:38 +00:00
|
|
|
- mkdir -p gitlab-exporter
|
|
|
|
- wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/master/index.js
|
2019-04-18 19:18:20 +00:00
|
|
|
- mkdir -p sitespeed-results
|
|
|
|
script:
|
|
|
|
- docker run --shm-size=1g --rm -v "$(pwd)":/sitespeed.io sitespeedio/sitespeed.io:6.3.1 --plugins.add ./gitlab-exporter --outputFolder sitespeed-results "${CI_ENVIRONMENT_URL}"
|
|
|
|
after_script:
|
2019-04-12 08:56:38 +00:00
|
|
|
- mv sitespeed-results/data/performance.json performance.json
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- sitespeed-results/
|
|
|
|
reports:
|
|
|
|
performance: performance.json
|
|
|
|
|
|
|
|
review-performance:
|
|
|
|
<<: *review-performance-base
|
|
|
|
|
2019-04-18 19:18:20 +00:00
|
|
|
schedule:review-performance:
|
|
|
|
<<: *review-performance-base
|
|
|
|
<<: *review-schedules-only
|
|
|
|
dependencies:
|
|
|
|
- schedule:review-deploy
|
2019-04-12 08:56:38 +00:00
|
|
|
|
|
|
|
schedule:review-cleanup:
|
|
|
|
<<: *review-base
|
|
|
|
<<: *review-schedules-only
|
2019-04-25 23:03:27 +00:00
|
|
|
stage: build
|
2019-04-12 08:56:38 +00:00
|
|
|
allow_failure: true
|
|
|
|
environment:
|
|
|
|
name: review/auto-cleanup
|
2019-04-25 23:03:27 +00:00
|
|
|
action: stop
|
2019-04-12 08:56:38 +00:00
|
|
|
before_script:
|
2019-04-18 19:18:20 +00:00
|
|
|
- source scripts/utils.sh
|
|
|
|
- install_gitlab_gem
|
2019-04-12 08:56:38 +00:00
|
|
|
script:
|
|
|
|
- ruby -rrubygems scripts/review_apps/automated_cleanup.rb
|
|
|
|
|
|
|
|
danger-review:
|
|
|
|
extends: .dedicated-pull-cache-job
|
|
|
|
image: registry.gitlab.com/gitlab-org/gitlab-build-images:danger
|
|
|
|
stage: test
|
|
|
|
dependencies: []
|
|
|
|
before_script: []
|
|
|
|
only:
|
|
|
|
variables:
|
|
|
|
- $DANGER_GITLAB_API_TOKEN
|
|
|
|
except:
|
|
|
|
refs:
|
|
|
|
- master
|
2019-08-05 22:56:43 +00:00
|
|
|
- /^\d+-\d+-auto-deploy-\d+$/
|
2019-08-02 17:51:33 +00:00
|
|
|
- /^[\d-]+-stable(-ee)?$/
|
2019-04-12 08:56:38 +00:00
|
|
|
variables:
|
|
|
|
- $CI_COMMIT_REF_NAME =~ /^ce-to-ee-.*/
|
|
|
|
- $CI_COMMIT_REF_NAME =~ /.*-stable(-ee)?-prepare-.*/
|
|
|
|
script:
|
|
|
|
- git version
|
|
|
|
- node --version
|
2019-07-02 14:29:47 +00:00
|
|
|
- yarn install --frozen-lockfile --cache-folder .yarn-cache --prefer-offline
|
2019-04-12 08:56:38 +00:00
|
|
|
- danger --fail-on-errors=true
|