Updated with new .gitlab-ci file

This commit is contained in:
Deon George 2016-07-11 02:01:44 +10:00
parent 7c74cbf76e
commit 1967ccebda
2 changed files with 14 additions and 12 deletions

View File

@ -1,26 +1,29 @@
image: leenooks/ci-docker:latest image: docker:latest
stages: stages:
- test - test
- build - build
services:
- leenooks/ci-docker:dind
variables: variables:
VERSION: "7" VERSION: "7"
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: before_script:
- test -n "${REGISTRY}" # Needs to be set in project
- test -n "${IMAGE}" # Needs to be set in project
- docker info - docker info
- docker version - 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: test:
stage: test stage: test
script: script:
- docker build -t ${IMAGE}:${VERSION} . - cat /etc/hosts
- env|sort
- docker build -t ${DOCKER_IMAGE}:${VERSION} .
- docker images - docker images
only: only:
- debug - debug
@ -28,9 +31,9 @@ test:
build: build:
stage: build stage: build
script: script:
- docker build -t ${IMAGE}:${VERSION} . - docker build -t ${DOCKER_IMAGE}:${VERSION} .
- docker tag ${IMAGE}:${VERSION} ${REGISTRY}/${IMAGE}:${VERSION} - docker tag ${DOCKER_IMAGE}:${VERSION} ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION}
- docker push ${REGISTRY}/${IMAGE}:${VERSION} - docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION}
tags: tags:
- docker - docker
only: only:

View File

@ -1,6 +1,5 @@
# NAME leenooks/base # NAME leenooks/base
# VERSION 7 # VERSION 7
# BUILD docker build -t="leenooks/base" .
FROM centos:7 FROM centos:7
MAINTAINER deon@leenooks.net MAINTAINER deon@leenooks.net