117 lines
3.6 KiB
YAML
117 lines
3.6 KiB
YAML
image: docker:latest
|
|
|
|
stages:
|
|
- build
|
|
- build-manifest
|
|
- build-test
|
|
- build-manifest-test
|
|
|
|
cache:
|
|
key: ${CI_COMMIT_REF_SLUG}
|
|
paths:
|
|
- docker/
|
|
|
|
variables:
|
|
BRANCH: alpine
|
|
VERSION: 8.1-fpm-${BRANCH}
|
|
DOCKER_HOST: tcp://docker:2375
|
|
VERSIONARCH: ${VERSION}-${ARCH}
|
|
|
|
services:
|
|
- docker:dind
|
|
|
|
before_script:
|
|
- sed -ie s'/https/http/' /etc/apk/repositories
|
|
- HTTP_PROXY=http://proxy.dege.lan:3128 apk add git curl
|
|
- docker info
|
|
- docker version
|
|
- env|sort
|
|
# docker login -u "$CI_DEPENDENCY_PROXY_USER" -p "$CI_DEPENDENCY_PROXY_PASSWORD" "$CI_SERVER_HOST"
|
|
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
|
|
|
|
x86_64:build:
|
|
variables:
|
|
ARCH: x86_64
|
|
stage: build
|
|
script:
|
|
- if [ -f init ]; then chmod 500 init; fi
|
|
- ([ -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
|
|
- x86_64
|
|
only:
|
|
- alpine
|
|
|
|
x86_64:build-test:
|
|
variables:
|
|
ARCH: x86_64
|
|
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
|
|
- x86_64
|
|
only:
|
|
- alpine
|
|
|
|
armv7l:build:
|
|
variables:
|
|
ARCH: armv7l
|
|
stage: build
|
|
script:
|
|
- if [ -f init ]; then chmod 500 init; fi
|
|
- ([ -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
|
|
tags:
|
|
- docker
|
|
- x86_64
|
|
only:
|
|
- alpine
|