From a163bce7817f25364ccab6a77c5def5a042cdd7c Mon Sep 17 00:00:00 2001 From: s3lph Date: Sun, 4 Nov 2018 03:11:42 +0100 Subject: [PATCH] Fixed CI script; failed on untagged commit --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6c49973..254a17b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,11 +34,11 @@ build_docker: script: - docker build -t "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" -f package/docker/Dockerfile . - docker tag "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_REF_NAME" - - '[[ -n "$CI_COMMIT_TAG" ]] && docker tag "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_TAG"' + - if [[ -n "$CI_COMMIT_TAG" ]]; then docker tag "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_TAG"; fi - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_TOKEN registry.gitlab.com - docker push "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" - docker push "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_REF_NAME" - - '[[ -n "$CI_COMMIT_TAG" ]] && docker push "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_TAG"' + - if [[ -n "$CI_COMMIT_TAG" ]]; then docker push "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_TAG"; fi only: - 27-deployment - staging