Using gitlab variables

This commit is contained in:
Deon George 2016-07-07 23:29:56 +10:00
parent dd2854b5ea
commit 29072821ba

View File

@ -7,19 +7,28 @@ services:
- leenooks/ci-docker:dind
variables:
REGISTRY: registry.leenooks.net
IMAGE: leenooks/base
VERSION: 6
before_script:
- env|sort
- docker info
- docker version
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${REGISTRY}
test:
stage: test
script:
- docker build -t ${IMAGE}:${VERSION} .
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:
- c6