This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
ci-docker/.gitlab-ci.yml

40 lines
721 B
YAML
Raw Normal View History

2016-07-08 06:57:16 +00:00
image: docker:latest
stages:
- test
- build
services:
- leenooks/ci-docker:dind
variables:
VERSION: dind
DOCKER_HOST: tcp://leenooks-ci-docker:2375
before_script:
- env|sort
- test -n "${REGISTRY}" # Needs to be set in project
- test -n "${IMAGE}" # Needs to be set in project
- docker info
- docker version
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${REGISTRY}
test:
stage: test
script:
- docker build -t ${IMAGE}:${VERSION} .
- docker images
only:
- debug
build:
stage: build
script:
- docker build -t ${IMAGE}:${VERSION} .
- docker tag ${IMAGE}:${VERSION} ${REGISTRY}/${IMAGE}:${VERSION}
- docker push ${REGISTRY}/${IMAGE}:${VERSION}
tags:
- docker
only:
- master