php/.gitlab-ci.yml

47 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2017-12-07 04:19:02 +00:00
image: docker:latest
stages:
- build
2021-07-06 05:36:16 +00:00
- build-test
2017-12-07 04:19:02 +00:00
variables:
2021-07-06 05:36:16 +00:00
BRANCH: server
2022-07-30 00:55:11 +00:00
VERSION: 8.1-fpm-${BRANCH}
CACHETAG: build-${BRANCH}
DOCKER_HOST: tcp://docker:2375
2017-12-07 04:19:02 +00:00
services:
- docker:dind
2017-12-07 04:19:02 +00:00
before_script:
- docker info
- docker version
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
2017-12-07 04:19:02 +00:00
x86_64:build:
2017-12-07 04:19:02 +00:00
stage: build
script:
- if [ -f init ]; then chmod 500 init; fi
2020-04-02 05:55:19 +00:00
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || true
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG}
2017-12-07 04:19:02 +00:00
tags:
- docker
- x86_64
2017-12-07 04:19:02 +00:00
only:
2021-07-06 05:36:16 +00:00
- server
x86_64:build-test:
stage: build-test
script:
- if [ -f init ]; then chmod 500 init; fi
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || true
- docker build --file Dockerfile.phptest --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION}-test .
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}-test
tags:
- docker
- x86_64
only:
- server