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