Skip to content
Snippets Groups Projects

Resolve "extend gitlab-ci process"

Merged Ulf Seltmann requested to merge 3-extend-gitlab-ci-process into master
Compare and
3 files
+ 73
8
Preferences
Compare changes
Files
3
+ 64
7
stages:
- image
- build
- publish
- mirror
'2.4':
stage: image
docker_build_image_2.4:
stage: build
image: docker:latest
services:
- docker:dind
script: |
mkdir -p ~/.docker && echo "$DOCKER_AUTH_CONFIG" >~/.docker/config.json
export suffix=`expr $CI_COMMIT_TAG ':' '2.4-\(.*\)'`
docker build --pull \
--build-arg HTTP_PROXY=${HTTP_PROXY} \
--build-arg HTTPS_PROXY=${HTTPS_PROXY} \
@@ -17,9 +16,65 @@ stages:
--build-arg http_proxy=${HTTP_PROXY} \
--build-arg https_proxy=${HTTPS_PROXY} \
--build-arg no_proxy=${NO_PROXY} \
-t ubleipzig/httpd:2.4 \
-t image \
-f 2.4/Dockerfile \
2.4
docker save --output=image.tar.gz image
artifacts:
name: docker-image
paths:
- image.tar.gz
tags:
- docker
docker_publish_alpha_2.4:
stage: publish
image: docker:latest
services:
- docker:dind
script: |
test "${DOCKER_AUTH_CONFIG}" == "" && echo "docker-config does not exists, aborting!" && false
mkdir -p ~/.docker && echo "$DOCKER_AUTH_CONFIG" >~/.docker/config.json
docker load --input=image.tar.gz
docker tag image ubleipzig/httpd:alpha-2.4-${CI_COMMIT_REF_NAME}
docker push ubleipzig/httpd:alpha-2.4-${CI_COMMIT_REF_NAME}
tags:
- docker
dependencies:
- docker_build_image_2.4
only:
- /^[0-9]+-/
docker_publish_staging_2.4:
stage: publish
image: docker:latest
services:
- docker:dind
script: |
test "${DOCKER_AUTH_CONFIG}" == "" && echo "docker-config does not exists, aborting!" && false
mkdir -p ~/.docker && echo "$DOCKER_AUTH_CONFIG" >~/.docker/config.json
docker load --input=image.tar.gz
docker tag image ubleipzig/httpd:staging
docker push ubleipzig/httpd:staging
tags:
- docker
dependencies:
- docker_build_image_2.4
only:
- master
docker_publish_production_2.4:
stage: publish
image: docker:latest
services:
- docker:dind
script: |
test "${DOCKER_AUTH_CONFIG}" == "" && echo "docker-config does not exists, aborting!" && false
mkdir -p ~/.docker && echo "$DOCKER_AUTH_CONFIG" >~/.docker/config.json
suffix=`expr $CI_COMMIT_TAG ':' '2.4-\(.*\)'`
docker load --input=image.tar.gz
docker tag image ubleipzig/httpd:2.4
docker push ubleipzig/httpd:2.4
for tag in "latest" "2" "2.4-${suffix}"; do
docker tag ubleipzig/httpd:2.4 ubleipzig/httpd:${tag}
@@ -27,8 +82,10 @@ stages:
done
tags:
- docker
dependencies:
- docker_build_image_2.4
only:
- /^2.4/
- /^2.4-/
except:
- branches