diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1743c667..1aaefeff 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,11 +8,12 @@ build-staging: image: $DOCKER_IMAGE rules: - if: '$CI_COMMIT_REF_NAME != "master"' - tags: ["runner:docker"] + tags: + - "arch:amd64" script: - - docker build -t registry.ddbuild.io/kafka-kit:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA} --label target=staging --target dd-image -f Dockerfile . - - docker push registry.ddbuild.io/kafka-kit:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA} - - ddsign sign registry.ddbuild.io/kafka-kit:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA} --digest-from-docker + - METADATA_FILE=$(mktemp) + - docker buildx build -t registry.ddbuild.io/kafka-kit:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA} --label target=staging --target dd-image -f Dockerfile --push --metadata-file ${METADATA_FILE} . + - ddsign sign registry.ddbuild.io/kafka-kit:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA} --docker-metadata-file ${METADATA_FILE} build-prod: @@ -22,8 +23,9 @@ build-prod: image: $DOCKER_IMAGE rules: - if: '$CI_COMMIT_REF_NAME == "master"' - tags: ["runner:docker"] + tags: + - "arch:amd64" script: - - docker build -t registry.ddbuild.io/kafka-kit:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA} --label target=prod --target dd-image -f Dockerfile . - - docker push registry.ddbuild.io/kafka-kit:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA} - - ddsign sign registry.ddbuild.io/kafka-kit:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA} --digest-from-docker + - METADATA_FILE=$(mktemp) + - docker buildx build -t registry.ddbuild.io/kafka-kit:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA} --label target=prod --target dd-image -f Dockerfile --push --metadata-file ${METADATA_FILE} . + - ddsign sign registry.ddbuild.io/kafka-kit:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA} --docker-metadata-file ${METADATA_FILE}