Commit 2f760080 authored by Konstantin Pavlov's avatar Konstantin Pavlov

CI: changed the way we push/tag images

parent bee73351
Pipeline #5947 passed with stage
in 48 seconds
.build-images: &build-images |
set -x
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
DIRS=""
CHANGED=$(for i in `git log --name-only --pretty=oneline --full-index $CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA | grep -vE '^[0-9a-f]{40} '`; do echo `dirname $i`; done | sort | uniq)
for dir in $CHANGED; do
......@@ -16,13 +15,28 @@
for d in $DIRS; do
[ -d "$d" ] || continue
DATE=`date +'%Y%m%d%H%M%S'`
/kaniko/executor --context `pwd`/$d --dockerfile Dockerfile --destination registry.videolan.org:5000/$d-aarch64:$DATE
docker build -t registry.videolan.org/$d-aarch64:$DATE $d/
docker push registry.videolan.org/$d-aarch64:$DATE
done
variables:
DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2
services:
- docker:dind
before_script:
- docker info
- apk add git
build:
stage: build
tags:
- docker
- aarch64
- dind
image:
name: registry.videolan.org:5000/videolan-kaniko-aarch64:20181206210540
entrypoint: [""]
name: docker:stable
script:
- *build-images
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