From e72fd88c11e3f2ae37a2b0f5b60141470b9d4f4b Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Thu, 29 Oct 2020 19:29:41 +0100 Subject: [PATCH] Removed docker pull as it is useless and only push to latest for now Signed-off-by: Louis Vallat --- .gitlab-ci.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c5e0fb5..08186f1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ variables: # Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled DOCKER_HOST: tcp://docker:2376 DOCKER_TLS_CERTDIR: "/certs" - CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + CONTAINER_BRANCH_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest before_script: @@ -45,13 +45,18 @@ test: - build/libs/*.jar - .gradle +release-image-test: + stage: release + script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker build . -t $CONTAINER_BRANCH_IMAGE + - docker push $CONTAINER_BRANCH_IMAGE + release-image: stage: release script: - - docker info - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker pull $CONTAINER_TEST_IMAGE - - docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE - - docker push $CONTAINER_RELEASE_IMAGE + - docker build . -t $CONTAINER_BRANCH_IMAGE -t $CONTAINER_RELEASE_IMAGE + - docker push $CONTAINER_RELEASE_IMAGE $CONTAINER_BRANCH_IMAGE only: - master \ No newline at end of file