Commit b5a8800a authored by Sven-Hendrik Haase's avatar Sven-Hendrik Haase
Browse files

Merge branch 'replacePublishWithKaniko' into 'master'

Replace publish with multi-destination kaniko

See merge request archlinux/archlinux-docker!46
parents 192c28c4 1038040a
......@@ -114,6 +114,7 @@ image:build:secure:
before_script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$GITLAB_PROJECT_USER\",\"password\":\"$GITLAB_PROJECT_TOKEN\"}}}" > /kaniko/.docker/config.json
# Build and publish to the Arch Linux group namespace: https://hub.docker.com/r/archlinux/archlinux
image:publish:secure:
extends: .image
retry: 2
......@@ -127,11 +128,17 @@ image:publish:secure:
before_script:
- echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"username\":\"$DOCKERHUB_USERNAME\",\"password\":\"$DOCKERHUB_ACCESS_TOKEN\"}}}" > /kaniko/.docker/config.json
script:
- LATEST=""
- if [[ "$GROUP" == "base" ]]; then
LATEST="--destination archlinux/archlinux:latest"
fi
- /kaniko/executor
--whitelist-var-run="false"
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile.$GROUP
--destination archlinux/archlinux:$GROUP
--destination archlinux/archlinux:$GROUP-$BUILD_VERSION
$LATEST
.test:
stage: test
......@@ -236,28 +243,8 @@ release:
reports:
dotenv: build.env
# Publish base to the Arch Linux group namespace: https://hub.docker.com/r/archlinux/archlinux
publish:
stage: publish
retry: 2
tags:
- secure
image:
name: gcr.io/go-containerregistry/crane:debug
entrypoint: [""]
variables:
GIT_STRATEGY: none
only:
- tags
before_script:
- echo $DOCKERHUB_ACCESS_TOKEN | crane auth login -u $DOCKERHUB_USERNAME --password-stdin index.docker.io
script:
- crane tag archlinux/archlinux:base-$BUILD_VERSION base
- crane tag archlinux/archlinux:base-$BUILD_VERSION latest
- crane tag archlinux/archlinux:base-devel-$BUILD_VERSION base-devel
# Publish to the official Docker namespace: https://hub.docker.com/_/archlinux
publish:official:
publish:
stage: publish
only:
refs:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment