From 025abc9d8efb337e986dd57c6cfa7f3b10881db1 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 7 Jul 2016 23:48:28 +1000 Subject: [PATCH] Updated .gitlab-ci.yml --- .gitlab-ci.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52b46ca..4294502 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,25 +1,37 @@ image: leenooks/ci-docker:latest stages: +- test - build services: - leenooks/ci-docker:dind variables: - REGISTRY: registry.leenooks.net - IMAGE: leenooks/base + VERSION: latest before_script: +- test -n "${REGISTRY}" # Needs to be set in project +- test -n "${IMAGE}" # Needs to be set in project - docker info - docker version - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${REGISTRY} +test: + stage: test + script: + - docker build -t ${IMAGE}:${VERSION} . + - docker images + only: + - debug + build: stage: build script: - - docker build -t ${IMAGE} . - - docker tag ${IMAGE} ${REGISTRY}/${IMAGE} - - docker push ${REGISTRY}/${IMAGE} + - docker build -t ${IMAGE}:${VERSION} . + - docker tag ${IMAGE}:${VERSION} ${REGISTRY}/${IMAGE}:${VERSION} + - docker push ${REGISTRY}/${IMAGE}:${VERSION} tags: - docker + only: + - master