Testing gitlab running caching

This commit is contained in:
Deon George 2017-07-22 22:32:59 +10:00
parent 66ff2ed33b
commit ee6d32d981

View File

@ -6,6 +6,7 @@ stages:
variables: variables:
VERSION: latest VERSION: latest
CACHETAG: build
DOCKER_IMAGE: graytech/otrs DOCKER_IMAGE: graytech/otrs
DOCKER_REGISTRY: registry.leenooks.net DOCKER_REGISTRY: registry.leenooks.net
DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375 DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375
@ -32,10 +33,11 @@ test:
build: build:
stage: build stage: build
script: script:
- docker build --cache-from ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:latest -t ${DOCKER_IMAGE}:${VERSION} -t ${DOCKER_IMAGE}:CI_BUILD . - docker pull ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:latest
- docker build --cache-from ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:latest -t ${DOCKER_IMAGE}:${VERSION} -t ${DOCKER_IMAGE}:${CACHETAG} .
- docker tag ${DOCKER_IMAGE}:${VERSION} ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION} - docker tag ${DOCKER_IMAGE}:${VERSION} ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION}
- docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION} - docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION}
- docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:CI_BUILD - docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${CACHETAG}
tags: tags:
- docker - docker
only: only: