commit 515679f5801a9e4aed06ce8df090d07a7d7d2c4b Author: Rebecca Valente Date: Tue Jul 8 00:23:50 2025 -0300 devops: implemented user authentication and improved error handling in login module. 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 new file mode 100644 index 0000000..6022cf7 --- /dev/null +++ b/pipelines/docker-image-build-then-push-to-local-registry.gitlab-ci.yml @@ -0,0 +1,27 @@ +image: docker:dind + +stages: + - build + - deploy + + +default: + before_script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + +build-and-push docker image to local registry: + stage: build + script: + - if ! test -z "$DOCKERFILE_DIRECTORY"; then cd ${DOCKERFILE_DIRECTORY}; fi + - docker build -f "${DOCKERFILE_NAME}" -t "${CI_REGISTRY_IMAGE}:${DOCKER_IMAGE_TAG}" --progress=plain . + - docker push "${CI_REGISTRY_IMAGE}:${DOCKER_IMAGE_TAG}" + +push docker to destination registry: + stage: deploy + script: + - if test -z "$DOCKER_REGISTRY"; then exit 0; fi + - docker pull "${CI_REGISTRY_IMAGE}:${DOCKER_IMAGE_TAG}" + - docker tag "${CI_REGISTRY_IMAGE}:${DOCKER_IMAGE_TAG}" "${DOCKER_REGISTRY}:${DOCKER_IMAGE_TAG}" + - docker push "${DOCKER_REGISTRY}:${DOCKER_IMAGE_TAG}" + needs: + - "build-and-push docker image to local registry"