diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 63e21d8..2568100 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,25 +1,31 @@ stages: + - auth - build - publish - deploy +auth-job: + stage: auth + image: docker:stable + script: + - docker login --username "$REGISTRY_USER" --password "$REGISTRY_PASSWORD" "$REGISTRY_BASE_URL" + artifacts: + paths: + - ~/.docker/ + build-job: stage: build image: docker:stable tags: - docker script: - - docker login --username "$REGISTRY_USER" --password "$REGISTRY_PASSWORD" "$REGISTRY_BASE_URL" - docker -H unix:///var/run/docker.sock image build -t "$REGISTRY_BASE_URL/$DOCKER_IMAGE_NAME:$CI_COMMIT_SHORT_SHA" ./ - artifacts: - paths: - - ~/.docker/ publish-job: stage: publish image: docker:stable dependencies: - - build-job + - auth-job tags: - docker script: @@ -30,7 +36,7 @@ deploy-job: when: manual image: google/cloud-sdk dependencies: - - build-job + - auth-job script: - export KUBECONFIG="$KUBE_AUTH" - cp "$ENV_PRODUCTION" "./build/.env.production"