2017-12-07 04:19:02 +00:00
|
|
|
image: docker:latest
|
|
|
|
|
|
|
|
stages:
|
|
|
|
- build
|
2023-01-31 22:52:51 +00:00
|
|
|
- build-manifest
|
2020-08-23 02:54:50 +00:00
|
|
|
- build-test
|
2023-01-31 22:52:51 +00:00
|
|
|
- build-manifest-test
|
|
|
|
|
|
|
|
cache:
|
|
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
|
|
paths:
|
|
|
|
- docker/
|
2017-12-07 04:19:02 +00:00
|
|
|
|
|
|
|
variables:
|
2023-01-31 22:52:51 +00:00
|
|
|
BRANCH: alpine
|
2022-07-30 00:51:02 +00:00
|
|
|
VERSION: 8.1-fpm-${BRANCH}
|
2019-01-22 00:48:13 +00:00
|
|
|
DOCKER_HOST: tcp://docker:2375
|
2023-01-31 22:52:51 +00:00
|
|
|
VERSIONARCH: ${VERSION}-${ARCH}
|
2017-12-07 04:19:02 +00:00
|
|
|
|
|
|
|
services:
|
2023-01-31 22:52:51 +00:00
|
|
|
- docker:dind
|
2017-12-07 04:19:02 +00:00
|
|
|
|
|
|
|
before_script:
|
2023-01-31 22:52:51 +00:00
|
|
|
- sed -ie s'/https/http/' /etc/apk/repositories
|
|
|
|
- HTTP_PROXY=http://proxy.dege.lan:3128 apk add git curl
|
2017-12-07 04:19:02 +00:00
|
|
|
- docker info
|
|
|
|
- docker version
|
2023-01-31 22:52:51 +00:00
|
|
|
- env|sort
|
|
|
|
# docker login -u "$CI_DEPENDENCY_PROXY_USER" -p "$CI_DEPENDENCY_PROXY_PASSWORD" "$CI_SERVER_HOST"
|
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
|
|
|
|
2019-01-22 00:48:13 +00:00
|
|
|
x86_64:build:
|
2023-01-31 22:52:51 +00:00
|
|
|
variables:
|
|
|
|
ARCH: x86_64
|
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
|
2023-01-31 22:52:51 +00:00
|
|
|
- ([ -z "$REFRESH" -a -f docker/${CI_COMMIT_REF_SLUG} ]) && docker load < docker/${CI_COMMIT_REF_SLUG} || true
|
|
|
|
- docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} .
|
|
|
|
- docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}
|
|
|
|
- docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > docker/${CI_COMMIT_REF_SLUG}
|
|
|
|
|
|
|
|
# apk add curl && curl -LX POST --post301 -F token=${TRIGGER_TOKEN} -F ref=image ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline
|
|
|
|
# apk add curl && curl -LX POST --post301 -F token=${TRIGGER_TOKEN} -F ref=server ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline
|
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:
|
2023-01-31 22:52:51 +00:00
|
|
|
- alpine
|
2020-08-23 02:54:50 +00:00
|
|
|
|
|
|
|
x86_64:build-test:
|
2023-01-31 22:52:51 +00:00
|
|
|
variables:
|
|
|
|
ARCH: x86_64
|
2020-08-23 02:54:50 +00:00
|
|
|
stage: build-test
|
|
|
|
script:
|
2023-01-31 22:52:51 +00:00
|
|
|
- docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --file Dockerfile.phptest -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test .
|
|
|
|
- docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
- x86_64
|
|
|
|
only:
|
|
|
|
- alpine
|
|
|
|
|
|
|
|
armv7l:build:
|
|
|
|
variables:
|
|
|
|
ARCH: armv7l
|
|
|
|
stage: build
|
|
|
|
script:
|
2020-08-23 02:54:50 +00:00
|
|
|
- if [ -f init ]; then chmod 500 init; fi
|
2023-01-31 22:52:51 +00:00
|
|
|
- ([ -z "$REFRESH" -a -f docker/${CI_COMMIT_REF_SLUG} ]) && docker load < docker/${CI_COMMIT_REF_SLUG} || true
|
|
|
|
- docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --cache-from ${CI_REGISTRY_IMAGE}:${VERSIONARCH} -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} .
|
|
|
|
- docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}
|
|
|
|
- docker save ${CI_REGISTRY_IMAGE}:${VERSIONARCH} > docker/${CI_COMMIT_REF_SLUG}
|
|
|
|
|
|
|
|
# apk add curl && curl -LX POST --post301 -F token=${TRIGGER_TOKEN} -F ref=image ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline
|
|
|
|
# apk add curl && curl -LX POST --post301 -F token=${TRIGGER_TOKEN} -F ref=server ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
- armv7l
|
|
|
|
only:
|
|
|
|
- alpine
|
|
|
|
|
|
|
|
armv7l:build-test:
|
|
|
|
variables:
|
|
|
|
ARCH: armv7l
|
|
|
|
stage: build-test
|
|
|
|
script:
|
|
|
|
- docker build --build-arg HTTP_PROXY=http://proxy.dege.lan:3128 --file Dockerfile.phptest -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test .
|
|
|
|
- docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}-test
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
- armv7l
|
|
|
|
only:
|
|
|
|
- alpine
|
|
|
|
|
|
|
|
x86_64:build-manifest:
|
|
|
|
stage: build-manifest
|
|
|
|
script:
|
|
|
|
- docker manifest create ${CI_REGISTRY_IMAGE}:${VERSION} ${CI_REGISTRY_IMAGE}:${VERSION}-armv7l ${CI_REGISTRY_IMAGE}:${VERSION}-x86_64
|
|
|
|
- docker manifest push --purge ${CI_REGISTRY_IMAGE}:${VERSION}
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
- x86_64
|
|
|
|
only:
|
|
|
|
- alpine
|
|
|
|
|
|
|
|
x86_64:build-manifest-test:
|
|
|
|
stage: build-manifest-test
|
|
|
|
script:
|
|
|
|
- docker manifest create ${CI_REGISTRY_IMAGE}:${VERSION}-test ${CI_REGISTRY_IMAGE}:${VERSION}-armv7l-test ${CI_REGISTRY_IMAGE}:${VERSION}-x86_64-test
|
|
|
|
- docker manifest push --purge ${CI_REGISTRY_IMAGE}:${VERSION}-test
|
2020-08-23 02:54:50 +00:00
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
- x86_64
|
|
|
|
only:
|
2023-01-31 22:52:51 +00:00
|
|
|
- alpine
|