php/.gitlab-ci.yml

45 lines
1.0 KiB
YAML
Raw Permalink Normal View History

2017-12-07 04:19:02 +00:00
image: docker:latest
stages:
- test
- build
variables:
BRANCH: plus
2021-03-03 02:57:40 +00:00
VERSION: 8.0-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
test:
stage: test
script:
- cat /etc/hosts
- env|sort
- docker build -t ${CI_REGISTRY_IMAGE}:${VERSION} .
2017-12-07 04:19:02 +00:00
- docker images
only:
- debug
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}
2021-06-30 06:13:46 +00:00
- apk add curl && curl -LX POST --post301 -F token=${TRIGGER_TOKEN} -F ref=ext ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline
2017-12-07 04:19:02 +00:00
tags:
- docker
- x86_64
2017-12-07 04:19:02 +00:00
only:
- plus