41 lines
808 B
YAML
41 lines
808 B
YAML
|
image: docker:latest
|
||
|
|
||
|
stages:
|
||
|
- test
|
||
|
- build
|
||
|
|
||
|
variables:
|
||
|
VERSION: 7.1-fpm-plus
|
||
|
DOCKER_IMAGE: leenooks/php
|
||
|
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}
|
||
|
|
||
|
test:
|
||
|
stage: test
|
||
|
script:
|
||
|
- cat /etc/hosts
|
||
|
- env|sort
|
||
|
- docker build -t ${DOCKER_IMAGE}:${VERSION} .
|
||
|
- docker images
|
||
|
only:
|
||
|
- debug
|
||
|
|
||
|
build:
|
||
|
stage: build
|
||
|
script:
|
||
|
- docker build -t ${DOCKER_IMAGE}:${VERSION} .
|
||
|
- docker tag ${DOCKER_IMAGE}:${VERSION} ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION}
|
||
|
- docker push ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${VERSION}
|
||
|
tags:
|
||
|
- docker
|
||
|
only:
|
||
|
- master
|