From 1694403c790cea0bcbe674eb1f07f54e6ed71246 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Sat, 3 Dec 2016 02:05:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20gitlab-ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .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..96ed414 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,33 @@ +image: docker:latest + +stages: + - build + - push + +before_script: + - docker login -u gitlab-ci -p $CI_BUILD_TOKEN registry.ely.by + +variables: + CONTAINER_IMAGE: registry.ely.by/elyby/skinsystem + +build: + stage: build + script: + - export IMAGE_NAME="$CONTAINER_IMAGE:dev" + - docker build --pull -t $IMAGE_NAME . + - docker push $IMAGE_NAME + only: + - develop + +push_tags: + stage: push + variables: + GIT_STRATEGY: none + script: + - export IMAGE_NAME="$CONTAINER_IMAGE:$CI_BUILD_TAG" + - docker tag $CONTAINER_IMAGE:dev $CONTAINER_IMAGE:latest + - docker tag $CONTAINER_IMAGE:latest $IMAGE_NAME + - docker push $IMAGE_NAME + - docker push $CONTAINER_IMAGE:latest + only: + - tags