From 4a090e739c98ae89f0c621377b95a05e76f86129 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Tue, 23 Apr 2019 23:32:02 +0200 Subject: [PATCH] Build and deploy --- .gitlab-ci.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f0d4932..5f5728b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,27 @@ image: docker:stable +variables: + DOCKER_HOST: tcp://docker:2375 + DOCKER_DRIVER: overlay2 + CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest + before_script: - - docker info + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY build: stage: build script: - - docker build -t vbrandl/hoc:latest . + - echo $CI_REGISTRY + - docker build --pull -t $CONTAINER_TEST_IMAGE . + - docker push $CONTAINER_TEST_IMAGE + # - docker build -t vbrandl/hoc:latest . + +release-image: + stage: release + script: + - docker pull $CONTAINER_TEST_IMAGE + - docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE + - docker push $CONTAINER_RELEASE_IMAGE + only: + - master