otrs/.gitlab-ci.yml

45 lines
1.1 KiB
YAML
Raw Normal View History

2017-07-21 13:53:55 +00:00
image: docker:latest
stages:
- test
- build
variables:
VERSION: latest
2017-07-22 12:32:59 +00:00
CACHETAG: build
2017-07-21 13:53:55 +00:00
DOCKER_IMAGE: graytech/otrs
DOCKER_REGISTRY: registry.leenooks.net
DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375
services:
- ${DOCKER_REGISTRY}/leenooks/ci-docker:dind
before_script:
- docker info
- docker version
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${DOCKER_REGISTRY}
2017-07-22 12:24:13 +00:00
- echo "CI_PROJECT_PATH ${CI_PROJECT_PATH} CI_COMMIT_TAG ${CI_COMMIT_TAG}"
2017-07-21 13:53:55 +00:00
test:
stage: test
script:
- cat /etc/hosts
- env|sort
- docker build -t ${DOCKER_IMAGE}:${VERSION} .
- docker images
only:
- debug
build:
stage: build
script:
2017-07-22 12:32:59 +00:00
- docker pull ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:latest
- docker build --cache-from ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:latest -t ${DOCKER_IMAGE}:${VERSION} -t ${DOCKER_IMAGE}:${CACHETAG} .
2017-07-21 13:53:55 +00:00
- docker tag ${DOCKER_IMAGE}:${VERSION} ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION}
- docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION}
2017-07-22 12:32:59 +00:00
- docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${CACHETAG}
2017-07-21 13:53:55 +00:00
tags:
- docker
only:
- master