From 0afff95280bf771a4cbd435a7e1e274f4b8f8b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 30 Mar 2022 11:00:47 +0200 Subject: [PATCH] ci: Add `needs` to all the push jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- .gitlab/ci/custom.images.yml | 263 +++++++++++++++++++++++--------- .gitlab/ci/customers.images.yml | 2 + .gitlab/ci/kas.images.yml | 1 + 3 files changed, 190 insertions(+), 76 deletions(-) diff --git a/.gitlab/ci/custom.images.yml b/.gitlab/ci/custom.images.yml index 325f040..6e14b51 100644 --- a/.gitlab/ci/custom.images.yml +++ b/.gitlab/ci/custom.images.yml @@ -1,4 +1,4 @@ -.test_build: &test_build +.test_build: extends: .test script: # Hack to set an array in /bin/sh @@ -7,7 +7,7 @@ - docker pull --quiet "$CI_REGISTRY_IMAGE:$1" || true - docker build --cache-from="$CI_REGISTRY_IMAGE:$1" -f "Dockerfile.$1" . -.build_and_deploy: &build_and_deploy +.build_and_deploy: extends: .deploy script: # Hack to set an array in /bin/sh @@ -18,95 +18,206 @@ - docker push "$CI_REGISTRY_IMAGE:$1" # Used by https://gitlab.com/gitlab-org/charts/auto-deploy-app/-/blob/master/.gitlab-ci.yml -alpine-helm test: *test_build +alpine-helm test: + extends: .test_build -danger test: *test_build -danger-ruby-2.6.6 test: *test_build -gitlab-charts-build-base test: *test_build -gitlab-charts-build-base-helm-3 test: *test_build -gitlab-helm3.5-kubectl1.17 test: *test_build -gitlab-qa-ruby-2.7 test: *test_build -gitlab-qa-ruby-3.0 test: *test_build -gitlab-qa-alpine-ruby-2.7 test: *test_build -gitlab-qa-alpine-ruby-3.0 test: *test_build -gitlab-puppeteer test: *test_build -kaniko test: *test_build -omnibus-gitlab-bionic test: *test_build -omnibus-gitlab-centos7 test: *test_build -omnibus-gitlab-centos8 test: *test_build -omnibus-gitlab-jessie test: *test_build -omnibus-gitlab-opensuse15.1 test: *test_build -omnibus-gitlab-opensuse15.2 test: *test_build -omnibus-gitlab-opensuse15.3 test: *test_build -omnibus-gitlab-stretch test: *test_build -omnibus-gitlab-buster test: *test_build -omnibus-gitlab-xenial test: *test_build -omnibus-gitlab-focal test: *test_build -omnibus-gitlab-amazonlinux2 test: *test_build -omnibus-gitlab-depscan test: *test_build -omnibus-gitlab-cve-search test: *test_build +danger test: + extends: .test_build +danger-ruby-2.6.6 test: + extends: .test_build +gitlab-charts-build-base test: + extends: .test_build +gitlab-charts-build-base-helm-3 test: + extends: .test_build +gitlab-helm3.5-kubectl1.17 test: + extends: .test_build +gitlab-qa-ruby-2.7 test: + extends: .test_build +gitlab-qa-ruby-3.0 test: + extends: .test_build +gitlab-qa-alpine-ruby-2.7 test: + extends: .test_build +gitlab-qa-alpine-ruby-3.0 test: + extends: .test_build +gitlab-puppeteer test: + extends: .test_build +kaniko test: + extends: .test_build +omnibus-gitlab-bionic test: + extends: .test_build +omnibus-gitlab-centos7 test: + extends: .test_build +omnibus-gitlab-centos8 test: + extends: .test_build +omnibus-gitlab-jessie test: + extends: .test_build +omnibus-gitlab-opensuse15.1 test: + extends: .test_build +omnibus-gitlab-opensuse15.2 test: + extends: .test_build +omnibus-gitlab-opensuse15.3 test: + extends: .test_build +omnibus-gitlab-stretch test: + extends: .test_build +omnibus-gitlab-buster test: + extends: .test_build +omnibus-gitlab-xenial test: + extends: .test_build +omnibus-gitlab-focal test: + extends: .test_build +omnibus-gitlab-amazonlinux2 test: + extends: .test_build +omnibus-gitlab-depscan test: + extends: .test_build +omnibus-gitlab-cve-search test: + extends: .test_build -release-tools test: *test_build -triage-ops-ruby-2.7 test: *test_build -sitespeed-gitlab test: *test_build -ubi-release test: *test_build -www-gitlab-com-ruby-3.0-node-16 test: *test_build -build-git: *test_build +release-tools test: + extends: .test_build +triage-ops-ruby-2.7 test: + extends: .test_build +sitespeed-gitlab test: + extends: .test_build +ubi-release test: + extends: .test_build +www-gitlab-com-ruby-3.0-node-16 test: + extends: .test_build +build-git test: + extends: .test_build # Used by GitLab: https://gitlab.com/gitlab-org/gitlab/-/blob/13-8-stable-ee/lib/gitlab/ci/templates/Terraform.gitlab-ci.yml -terraform test: *test_build +terraform test: + extends: .test_build # Used by go projects for linting https://gitlab.com/gitlab-org/gitlab/blob/master/doc/development/go_guide/index.md#automatic-linting -golangci-lint-alpine test: *test_build +golangci-lint-alpine test: + extends: .test_build # Used by gitlab-operator: https://gitlab.com/gitlab-org/gl-openshift/gitlab-operator -gitlab-operator-build-base test: *test_build +gitlab-operator-build-base test: + extends: .test_build -alpine-bash-jq-curl-git test: *test_build +alpine-bash-jq-curl-git test: + extends: .test_build # Used by frontend related tasks for linting GraphQL -apollo test: *test_build +apollo test: + extends: .test_build # Used by https://gitlab.com/gitlab-org/charts/auto-deploy-app/-/blob/master/.gitlab-ci.yml -alpine-helm push: *build_and_deploy +alpine-helm push: + extends: .build_and_deploy + needs: ["alpine-helm test"] -danger push: *build_and_deploy -danger-ruby-2.6.6 push: *build_and_deploy -gitlab-charts-build-base push: *build_and_deploy -gitlab-charts-build-base-helm-3 push: *build_and_deploy -gitlab-helm3.5-kubectl1.17 push: *build_and_deploy -gitlab-qa-ruby-2.7 push: *build_and_deploy -gitlab-qa-ruby-3.0 push: *build_and_deploy -gitlab-qa-alpine-ruby-2.7 push: *build_and_deploy -gitlab-qa-alpine-ruby-3.0 push: *build_and_deploy -gitlab-puppeteer push: *build_and_deploy -kaniko push: *build_and_deploy -omnibus-gitlab-bionic push: *build_and_deploy -omnibus-gitlab-centos7 push: *build_and_deploy -omnibus-gitlab-centos8 push: *build_and_deploy -omnibus-gitlab-jessie push: *build_and_deploy -omnibus-gitlab-opensuse15.1 push: *build_and_deploy -omnibus-gitlab-opensuse15.2 push: *build_and_deploy -omnibus-gitlab-opensuse15.3 push: *build_and_deploy -omnibus-gitlab-stretch push: *build_and_deploy -omnibus-gitlab-buster push: *build_and_deploy -omnibus-gitlab-xenial push: *build_and_deploy -omnibus-gitlab-focal push: *build_and_deploy -omnibus-gitlab-amazonlinux2 push: *build_and_deploy -omnibus-gitlab-depscan push: *build_and_deploy -omnibus-gitlab-cve-search push: *build_and_deploy -release-tools push: *build_and_deploy -triage-ops-ruby-2.7 push: *build_and_deploy -sitespeed-gitlab push: *build_and_deploy -ubi-release push: *build_and_deploy -www-gitlab-com-ruby-3.0-node-16 push: *build_and_deploy -build-git push: *build_and_deploy +danger push: + extends: .build_and_deploy + needs: ["danger test"] +danger-ruby-2.6.6 push: + extends: .build_and_deploy + needs: ["danger-ruby-2.6.6 test"] +gitlab-charts-build-base push: + extends: .build_and_deploy + needs: ["gitlab-charts-build-base test"] +gitlab-charts-build-base-helm-3 push: + extends: .build_and_deploy + needs: ["gitlab-charts-build-base-helm-3 test"] +gitlab-helm3.5-kubectl1.17 push: + extends: .build_and_deploy + needs: ["gitlab-helm3.5-kubectl1.17 test"] +gitlab-qa-ruby-2.7 push: + extends: .build_and_deploy + needs: ["gitlab-qa-ruby-2.7 test"] +gitlab-qa-ruby-3.0 push: + extends: .build_and_deploy + needs: ["gitlab-qa-ruby-3.0 test"] +gitlab-qa-alpine-ruby-2.7 push: + extends: .build_and_deploy + needs: ["gitlab-qa-alpine-ruby-2.7 test"] +gitlab-qa-alpine-ruby-3.0 push: + extends: .build_and_deploy + needs: ["gitlab-qa-alpine-ruby-3.0 test"] +gitlab-puppeteer push: + extends: .build_and_deploy + needs: ["gitlab-puppeteer test"] +kaniko push: + extends: .build_and_deploy + needs: ["kaniko test"] +omnibus-gitlab-bionic push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-bionic test"] +omnibus-gitlab-centos7 push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-centos7 test"] +omnibus-gitlab-centos8 push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-centos8 test"] +omnibus-gitlab-jessie push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-jessie test"] +omnibus-gitlab-opensuse15.1 push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-opensuse15.1 test"] +omnibus-gitlab-opensuse15.2 push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-opensuse15.2 test"] +omnibus-gitlab-opensuse15.3 push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-opensuse15.3 test"] +omnibus-gitlab-stretch push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-stretch test"] +omnibus-gitlab-buster push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-buster test"] +omnibus-gitlab-xenial push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-xenial test"] +omnibus-gitlab-focal push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-focal test"] +omnibus-gitlab-amazonlinux2 push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-amazonlinux2 test"] +omnibus-gitlab-depscan push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-depscan test"] +omnibus-gitlab-cve-search push: + extends: .build_and_deploy + needs: ["omnibus-gitlab-cve-search test"] +release-tools push: + extends: .build_and_deploy + needs: ["release-tools test"] +triage-ops-ruby-2.7 push: + extends: .build_and_deploy + needs: ["triage-ops-ruby-2.7 test"] +sitespeed-gitlab push: + extends: .build_and_deploy + needs: ["sitespeed-gitlab test"] +ubi-release push: + extends: .build_and_deploy + needs: ["ubi-release test"] +www-gitlab-com-ruby-3.0-node-16 push: + extends: .build_and_deploy + needs: ["www-gitlab-com-ruby-3.0-node-16 test"] +build-git push: + extends: .build_and_deploy + needs: ["build-git test"] # Used by GitLab: https://gitlab.com/gitlab-org/gitlab/-/blob/13-8-stable-ee/lib/gitlab/ci/templates/Terraform.gitlab-ci.yml -terraform push: *build_and_deploy +terraform push: + extends: .build_and_deploy + needs: ["terraform test"] # Used by go projects for linting https://gitlab.com/gitlab-org/gitlab/blob/master/doc/development/go_guide/index.md#automatic-linting -golangci-lint-alpine push: *build_and_deploy +golangci-lint-alpine push: + extends: .build_and_deploy + needs: ["golangci-lint-alpine test"] # Used by gitlab-operator: https://gitlab.com/gitlab-org/gl-openshift/gitlab-operator -gitlab-operator-build-base push: *build_and_deploy +gitlab-operator-build-base push: + extends: .build_and_deploy + needs: ["gitlab-operator-build-base test"] -alpine-bash-jq-curl-git push: *build_and_deploy +alpine-bash-jq-curl-git push: + extends: .build_and_deploy + needs: ["alpine-bash-jq-curl-git test"] # Used by frontend related tasks for linting GraphQL -apollo push: *build_and_deploy +apollo push: + extends: .build_and_deploy + needs: ["apollo test"] diff --git a/.gitlab/ci/customers.images.yml b/.gitlab/ci/customers.images.yml index 92748ee..60705f6 100644 --- a/.gitlab/ci/customers.images.yml +++ b/.gitlab/ci/customers.images.yml @@ -21,6 +21,7 @@ customers push: extends: - .customers-matrix - .build_and_deploy_custom + needs: ["customers test"] # Used by customers-gitlab-com qa e2e test: https://gitlab.com/gitlab-org/customers-gitlab-com/-/blob/staging/.gitlab/ci/e2e.gitlab-ci.yml .customers-qa-matrix: @@ -43,3 +44,4 @@ customers-qa-assets push: extends: - .customers-qa-matrix - .build_and_deploy_custom + needs: ["customers-qa-assets test"] diff --git a/.gitlab/ci/kas.images.yml b/.gitlab/ci/kas.images.yml index 08cc802..ab8a66f 100644 --- a/.gitlab/ci/kas.images.yml +++ b/.gitlab/ci/kas.images.yml @@ -22,3 +22,4 @@ gitlab-kas push: extends: - .gitlab-kas-matrix - .build_and_deploy_custom + needs: ["gitlab-kas test"]