diff options
Diffstat (limited to '.gitlab')
-rw-r--r-- | .gitlab/ci/global.gitlab-ci.yml | 2 | ||||
-rw-r--r-- | .gitlab/ci/reports.gitlab-ci.yml | 2 | ||||
-rw-r--r-- | .gitlab/ci/review.gitlab-ci.yml | 127 |
3 files changed, 77 insertions, 54 deletions
diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index 94d7d2cdaa4..1cccc6feed5 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -102,7 +102,7 @@ refs: - schedules variables: - - $REVIEW_APP_CLEANUP && $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" + - $CI_SERVER_HOST == "gitlab.com" && $CI_PROJECT_NAMESPACE == "gitlab-org" kubernetes: active .use-pg: diff --git a/.gitlab/ci/reports.gitlab-ci.yml b/.gitlab/ci/reports.gitlab-ci.yml index 38da73034d5..e380838ea7d 100644 --- a/.gitlab/ci/reports.gitlab-ci.yml +++ b/.gitlab/ci/reports.gitlab-ci.yml @@ -44,6 +44,8 @@ code_quality: # We need to duplicate this job's definition because it seems it's impossible to # override an included `only.refs`. # See https://gitlab.com/gitlab-org/gitlab/issues/31371. +# Once https://gitlab.com/gitlab-org/gitlab/merge_requests/16487 will be deployed +# to GitLab.com, we should be able to use the template and set SAST_DISABLE_DIND: "true". sast: extends: - .default-retry diff --git a/.gitlab/ci/review.gitlab-ci.yml b/.gitlab/ci/review.gitlab-ci.yml index c7b79dac9dd..9251644911f 100644 --- a/.gitlab/ci/review.gitlab-ci.yml +++ b/.gitlab/ci/review.gitlab-ci.yml @@ -1,15 +1,3 @@ -.review-base: - extends: - - .default-tags - - .default-retry - - .default-only - - .only-review - - .only-code-qa-changes - image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base - dependencies: [] - before_script: - - source scripts/utils.sh - .review-docker: extends: - .default-tags @@ -41,6 +29,25 @@ build-qa-image: - echo "${CI_JOB_TOKEN}" | docker login --username gitlab-ci-token --password-stdin ${CI_REGISTRY} - time docker push ${QA_IMAGE} +schedule:review-cleanup: + extends: + - .default-tags + - .default-retry + - .default-only + - .only-code-qa-changes + - .only-review-schedules + stage: prepare + image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base + 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 + .review-build-cng-base: extends: - .default-only @@ -68,9 +75,15 @@ schedule:review-build-cng: needs: ["gitlab:assets:compile"] .review-deploy-base: - extends: .review-base - allow_failure: true + extends: + - .default-tags + - .default-retry + - .default-only + - .only-code-qa-changes stage: review + image: registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-charts-build-base + dependencies: [] + allow_failure: true variables: HOST_SUFFIX: "${CI_ENVIRONMENT_SLUG}" DOMAIN: "-${CI_ENVIRONMENT_SLUG}.${REVIEW_APPS_DOMAIN}" @@ -105,6 +118,7 @@ schedule:review-build-cng: review-deploy: extends: - .review-deploy-base + - .only-review needs: ["review-build-cng"] schedule:review-deploy: @@ -148,6 +162,7 @@ review-cleanup-failed-deployment: - .only-review - .only-code-qa-changes stage: qa + allow_failure: true variables: QA_ARTIFACTS_DIR: "${CI_PROJECT_DIR}/qa" QA_CAN_TEST_GIT_PROTOCOL_V2: "false" @@ -176,13 +191,11 @@ review-cleanup-failed-deployment: review-qa-smoke: extends: .review-qa-base - allow_failure: true script: - gitlab-qa Test::Instance::Smoke "${QA_IMAGE}" "${CI_ENVIRONMENT_URL}" review-qa-all: extends: .review-qa-base - allow_failure: true when: manual parallel: 5 script: @@ -190,39 +203,32 @@ review-qa-all: - 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 -parallel-spec-reports: +.review-performance-base: extends: - - .default-tags - - .default-only + - .review-docker - .only-code-qa-changes - - .only-review - image: ruby:2.6-alpine - stage: post-test - 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/" + stage: qa allow_failure: true - when: manual + before_script: + - export CI_ENVIRONMENT_URL="$(cat review_app_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: + - 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: + - mv sitespeed-results/data/performance.json performance.json artifacts: - when: always paths: - - qa/report-new.html - - qa/gitlab-qa-run-* + - sitespeed-results/ 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 --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 + performance: performance.json review-performance: - extends: .review-qa-base - allow_failure: true + extends: + - .review-performance-base + - .only-review before_script: - export CI_ENVIRONMENT_URL="$(cat review_app_url.txt)" - echo "${CI_ENVIRONMENT_URL}" @@ -241,24 +247,39 @@ review-performance: schedule:review-performance: extends: - - review-performance + - .review-performance-base - .only-review-schedules dependencies: ["schedule:review-deploy"] -schedule:review-cleanup: +parallel-spec-reports: extends: - - .review-base - - .only-review-schedules - stage: prepare + - .default-tags + - .default-only + - .only-code-qa-changes + - .only-review + image: ruby:2.6-alpine + stage: post-test + 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/" allow_failure: true - environment: - name: review/auto-cleanup - action: stop - before_script: - - source scripts/utils.sh - - install_gitlab_gem + when: manual + artifacts: + when: always + paths: + - qa/report-new.html + - qa/gitlab-qa-run-* + reports: + junit: qa/gitlab-qa-run-*/**/rspec-*.xml script: - - ruby -rrubygems scripts/review_apps/automated_cleanup.rb + - 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 danger-review: extends: |