From f1d91d63ef36ee16c0407e1cb02f9eec1c7c8d1c Mon Sep 17 00:00:00 2001 From: Rebecca Valente Date: Tue, 8 Jul 2025 12:56:10 -0300 Subject: [PATCH] devops: added stages and jobs for building and pushing docker images to the local registry. --- ...age-build-then-push-to-local-registry.gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pipelines/docker-image-build-then-push-to-local-registry.gitlab-ci.yml b/pipelines/docker-image-build-then-push-to-local-registry.gitlab-ci.yml index 8ac41cd..6812b1e 100644 --- a/pipelines/docker-image-build-then-push-to-local-registry.gitlab-ci.yml +++ b/pipelines/docker-image-build-then-push-to-local-registry.gitlab-ci.yml @@ -16,6 +16,11 @@ build-and-push docker image to local registry: - if ! test -z "$DOCKERFILE_DIRECTORY"; then cd ${DOCKERFILE_DIRECTORY}; fi - docker build -f "${DOCKERFILE_NAME}" ${DOCKER_EXTRA_OPTS} -t "${CI_REGISTRY_IMAGE}:${DOCKER_IMAGE_TAG}" --progress=plain . - docker push "${CI_REGISTRY_IMAGE}:${DOCKER_IMAGE_TAG}" + only: + - main + - development + - staging + - develop push docker to destination registry: stage: deploy @@ -26,3 +31,8 @@ push docker to destination registry: - docker push "${DOCKER_REGISTRY}:${DOCKER_IMAGE_TAG}" needs: - "build-and-push docker image to local registry" + only: + - main + - development + - staging + - develop \ No newline at end of file