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.
base/.gitlab-ci.yml

41 lines
784 B
YAML
Raw Normal View History

image: docker:latest
stages:
2016-07-07 13:35:03 +00:00
- test
- build
2016-05-26 12:09:23 +00:00
services:
2016-07-08 07:17:43 +00:00
- registry.leenooks.net/leenooks/ci-docker:dind
variables:
VERSION: latest
2016-07-08 07:22:21 +00:00
DOCKER_HOST: tcp://registry.leenooks.net-leenooks-ci-docker:2375
2016-05-26 12:09:23 +00:00
before_script:
2016-07-08 07:20:55 +00:00
- cat /etc/hosts
2016-07-07 13:29:56 +00:00
- env|sort
2016-07-07 13:50:47 +00:00
- test -n "${REGISTRY}" # Needs to be set in project
- test -n "${IMAGE}" # Needs to be set in project
2016-05-26 12:09:23 +00:00
- docker info
- docker version
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${REGISTRY}
2016-05-26 12:09:23 +00:00
2016-07-07 13:29:56 +00:00
test:
stage: test
script:
- docker build -t ${IMAGE}:${VERSION} .
2016-07-07 13:50:47 +00:00
- docker images
2016-07-07 13:29:56 +00:00
only:
- debug
2016-07-07 13:50:47 +00:00
2016-05-26 12:09:23 +00:00
build:
stage: build
script:
2016-07-07 13:29:56 +00:00
- docker build -t ${IMAGE}:${VERSION} .
- docker tag ${IMAGE}:${VERSION} ${REGISTRY}/${IMAGE}:${VERSION}
- docker push ${REGISTRY}/${IMAGE}:${VERSION}
tags:
- docker
2016-07-07 13:29:56 +00:00
only:
2016-07-07 13:50:47 +00:00
- master