From 2d496e2882b2a711ac304e69c2e661f3b7cf16ba Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Thu, 11 Mar 2021 23:16:52 +0100 Subject: [PATCH] Added .gitlab-ci.yml Signed-off-by: Louis Vallat --- .gitlab-ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..4d4fd6a --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,33 @@ +image: docker:latest +services: + - docker:dind + +stages: + - release + +# Disable the Gradle daemon for Continuous Integration servers as correctness +# is usually a priority over speed in CI environments. Using a fresh +# runtime for each build is more reliable since the runtime is completely +# isolated from any previous builds. +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_BRANCH_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest + +release: + 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-master: + stage: release + script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker build . -t $CONTAINER_RELEASE_IMAGE + - docker push $CONTAINER_RELEASE_IMAGE + only: + - master