From 0aad13dc2988956ebf7770ae04200cc806f36a5e Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 11 Jul 2016 02:04:10 +1000 Subject: [PATCH] Updated with new .gitlab-ci file --- .gitlab-ci.yml | 25 ++++++++++++++----------- Dockerfile | 1 - 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 908dc59..82f9d4a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,26 +1,29 @@ -image: leenooks/ci-docker:latest +image: docker:latest stages: - test - build -services: -- leenooks/ci-docker:dind - variables: VERSION: "6" + DOCKER_IMAGE: leenooks/base + DOCKER_REGISTRY: registry.leenooks.net + DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375 + +services: +- ${DOCKER_REGISTRY}/leenooks/ci-docker:dind 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} +- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${DOCKER_REGISTRY} test: stage: test script: - - docker build -t ${IMAGE}:${VERSION} . + - cat /etc/hosts + - env|sort + - docker build -t ${DOCKER_IMAGE}:${VERSION} . - docker images only: - debug @@ -28,9 +31,9 @@ test: build: stage: build script: - - docker build -t ${IMAGE}:${VERSION} . - - docker tag ${IMAGE}:${VERSION} ${REGISTRY}/${IMAGE}:${VERSION} - - docker push ${REGISTRY}/${IMAGE}:${VERSION} + - docker build -t ${DOCKER_IMAGE}:${VERSION} . + - docker tag ${DOCKER_IMAGE}:${VERSION} ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION} + - docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION} tags: - docker only: diff --git a/Dockerfile b/Dockerfile index 448ca21..9c8e4a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ # NAME leenooks/base # VERSION 6 -# BUILD docker build -t="leenooks/base" . FROM centos:6 MAINTAINER deon@leenooks.net