ci: Only build custom images that need to be rebuilt

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2023-01-25 18:39:28 +01:00
parent ccd8e00291
commit 684f0ce8ef
No known key found for this signature in database
10 changed files with 125 additions and 62 deletions

View file

@ -1,72 +1,54 @@
.build_and_deploy:
extends: .build_and_push
script:
# Hack to set an array in /bin/sh
# http://unix.stackexchange.com/a/137571
- set -- $CI_JOB_NAME
- |
docker buildx build \
--cache-to=type=inline \
--cache-from="$CI_REGISTRY_IMAGE:$1" \
--platform=linux/${ARCH:-amd64} \
--push="${PUSH_CUSTOM_IMAGE:-false}" \
--label "ci_pipeline_url=$CI_PIPELINE_URL" \
--label "ci_job_url=$CI_JOB_URL" \
-t "$CI_REGISTRY_IMAGE:$1" \
-f "Dockerfile.$1" \
.
danger:
extends: .build_and_deploy
extends: .build_static_image
gitlab-charts-build-base-helm-3.7:
extends: .build_and_deploy
extends: .build_static_image
gitlab-helm3.5-kubectl1.17:
extends: .build_and_deploy
extends: .build_static_image
gitlab-vscode-nodeless:
extends: .build_and_deploy
extends: .build_static_image
kaniko:
extends: .build_and_deploy
extends: .build_static_image
release-tools:
extends: .build_and_deploy
extends: .build_static_image
triage-ops-ruby-2.7:
extends: .build_and_deploy
extends: .build_static_image
sitespeed-gitlab:
extends: .build_and_deploy
extends: .build_static_image
ubi-release:
extends: .build_and_deploy
extends: .build_static_image
www-gitlab-com-debian-bullseye-ruby-3.0-node-16:
extends: .build_and_deploy
extends: .build_static_image
build-git:
extends: .build_and_deploy
extends: .build_static_image
# Used by GitLab: https://gitlab.com/gitlab-org/gitlab/-/blob/13-8-stable-ee/lib/gitlab/ci/templates/Terraform.gitlab-ci.yml
terraform:
extends: .build_and_deploy
extends: .build_static_image
# 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:
extends: .build_and_deploy
extends: .build_static_image
# Used by gitlab-operator: https://gitlab.com/gitlab-org/cloud-native/gitlab-operator
gitlab-operator-build-base-golang-1.18:
extends: .build_and_deploy
extends: .build_static_image
alpine-bash-jq-curl-git:
extends: .build_and_deploy
extends: .build_static_image
# Used by frontend related tasks for linting GraphQL
apollo:
extends: .build_and_deploy
extends: .build_static_image
zoekt-ci-image:
extends: .build_and_deploy
extends: .build_static_image