Updated .gitlab-ci

This commit is contained in:
Deon George 2017-07-23 08:36:45 +10:00
parent 7011731d01
commit 05a6540ef1

View File

@ -5,9 +5,10 @@ stages:
- build - build
variables: variables:
VERSION: php70 VERSION: latest
DOCKER_IMAGE: leenooks/ldap CACHETAG: build
DOCKER_REGISTRY: registry.leenooks.net DOCKER_REGISTRY: registry.leenooks.net
DOCKER_IMAGE: ${DOCKER_REGISTRY}/${CI_PROJECT_PATH}
DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375 DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375
services: services:
@ -25,6 +26,8 @@ test:
- env|sort - env|sort
- docker build -t ${DOCKER_IMAGE}:${VERSION} . - docker build -t ${DOCKER_IMAGE}:${VERSION} .
- docker images - docker images
- echo "CI_PROJECT_PATH ${CI_PROJECT_PATH} CI_COMMIT_TAG ${CI_COMMIT_TAG} CI_COMMIT_REF_NAME ${CI_COMMIT_REF_NAME}"
- echo "CI_REGISTRY ${CI_REGISTRY} CI_REGISTRY_IMAGE ${CI_REGISTRY_IMAGE} CI ${CI}"
only: only:
- debug - debug
@ -32,9 +35,10 @@ build:
stage: build stage: build
script: script:
- chmod 500 init - chmod 500 init
- docker build -t ${DOCKER_IMAGE}:${VERSION} . - docker pull ${DOCKER_IMAGE}:${CACHETAG}
- docker tag ${DOCKER_IMAGE}:${VERSION} ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION} - docker build --cache-from ${DOCKER_IMAGE}:${CACHETAG} -t ${DOCKER_IMAGE}:${VERSION} -t ${DOCKER_IMAGE}:${CACHETAG} .
- docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION} - docker push ${DOCKER_IMAGE}:${VERSION}
- docker push ${DOCKER_IMAGE}:${CACHETAG}
tags: tags:
- docker - docker
only: only: