From cc34d72c73b311fb37fd100575f28b87fd7fc42f Mon Sep 17 00:00:00 2001 From: s3lph Date: Sun, 4 Nov 2018 02:51:57 +0100 Subject: [PATCH] Fixed docker build task --- .gitlab-ci.yml | 5 ++++- package/release.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 880eb01..6c49973 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,12 +32,15 @@ codestyle: build_docker: stage: build script: - - docker build -t "registry.gitlab.com/s3lph/matemat:$CI_COMMIT_SHA" package/docker + - 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"' - 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"' only: + - 27-deployment - staging - master - tags diff --git a/package/release.py b/package/release.py index 65b6599..263b674 100755 --- a/package/release.py +++ b/package/release.py @@ -98,7 +98,8 @@ def main(): - [Python Wheel]({wheel_url}) ([sha256]({wheel_sha_url})) - [Debian Package]({debian_url}) ([sha256]({debian_sha_url})) -- [Arch Linux Package]({arch_url}) ([sha256]({arch_sha_url}))''' +- [Arch Linux Package]({arch_url}) ([sha256]({arch_sha_url})) +- Docker image: registry.gitlab.com/{project_name}:{release_tag}''' encoder = json.encoder.JSONEncoder() decoder = json.decoder.JSONDecoder()