2017-12-07 04:19:02 +00:00
|
|
|
image: docker:latest
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- test
|
|
|
|
- build
|
2020-08-23 02:54:50 +00:00
|
|
|
- build-test
|
2017-12-07 04:19:02 +00:00
|
|
|
|
|
|
|
variables:
|
2018-05-04 13:54:52 +00:00
|
|
|
BRANCH: mp
|
2020-07-31 06:57:05 +00:00
|
|
|
VERSION: 7.4-fpm-${BRANCH}
|
2018-01-29 02:47:25 +00:00
|
|
|
CACHETAG: build-${BRANCH}
|
2019-01-22 00:48:13 +00:00
|
|
|
DOCKER_HOST: tcp://docker:2375
|
2017-12-07 04:19:02 +00:00
|
|
|
|
|
|
|
services:
|
2019-01-22 00:48:13 +00:00
|
|
|
- docker:dind
|
2017-12-07 04:19:02 +00:00
|
|
|
|
|
|
|
before_script:
|
|
|
|
- docker info
|
|
|
|
- docker version
|
2018-02-27 08:53:56 +00:00
|
|
|
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
|
2017-12-07 04:19:02 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
stage: test
|
|
|
|
script:
|
|
|
|
- cat /etc/hosts
|
|
|
|
- env|sort
|
2017-12-13 11:01:01 +00:00
|
|
|
- docker build -t ${CI_REGISTRY_IMAGE}:${VERSION} .
|
2017-12-07 04:19:02 +00:00
|
|
|
- docker images
|
|
|
|
only:
|
|
|
|
- debug
|
|
|
|
|
2019-01-22 00:48:13 +00:00
|
|
|
x86_64:build:
|
2017-12-07 04:19:02 +00:00
|
|
|
stage: build
|
|
|
|
script:
|
2018-02-27 08:53:56 +00:00
|
|
|
- if [ -f init ]; then chmod 500 init; fi
|
2019-09-09 11:22:54 +00:00
|
|
|
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true"
|
2017-12-13 11:01:01 +00:00
|
|
|
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
|
|
|
|
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
|
2018-01-29 02:47:25 +00:00
|
|
|
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG}
|
2017-12-07 04:19:02 +00:00
|
|
|
tags:
|
|
|
|
- docker
|
2019-01-22 00:48:13 +00:00
|
|
|
- x86_64
|
2017-12-07 04:19:02 +00:00
|
|
|
only:
|
2018-01-29 02:52:35 +00:00
|
|
|
- mysql
|
2020-08-23 02:54:50 +00:00
|
|
|
|
|
|
|
x86_64:build-test:
|
|
|
|
stage: build-test
|
|
|
|
script:
|
|
|
|
- if [ -f init ]; then chmod 500 init; fi
|
|
|
|
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || echo "true"
|
2020-08-24 05:58:49 +00:00
|
|
|
- docker build --file Dockerfile.phptest --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION}-test
|
2020-08-23 02:54:50 +00:00
|
|
|
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}-test
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
- x86_64
|
|
|
|
only:
|
|
|
|
- mysql
|