aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2020-08-06 13:25:28 +0200
committerGerd Hoffmann <kraxel@redhat.com>2020-08-06 13:25:28 +0200
commita6f63c25602577796576ccd9fe075c588626b194 (patch)
treefcec3db377c30ef4650bd843893ec948b4a7692e
parentf04b90e51381607bb097b56e5384861d6026cc57 (diff)
downloadrpm-package-builder-a6f63c25602577796576ccd9fe075c588626b194.tar.gz
ci: tag branch name
-rw-r--r--.gitlab-ci.yml28
1 files changed, 25 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ff1ab9e..7affaf7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,25 @@
-include:
- - project: 'kraxel/podman-docker-builder'
- file: 'gitlab-ci-template.yml'
+# https://blog.callr.tech/building-docker-images-with-gitlab-ci-best-practices/
+# comments dropped, updated for podman builds
+# this variant builds without caching
+
+image: registry.gitlab.com/kraxel/podman-docker-builder:latest
+
+stages:
+ - build
+
+before_script:
+ - podman login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
+
+Build:
+ stage: build
+ only:
+ - branches
+ script:
+ - >
+ podman build
+ --build-arg VCS_REF=$CI_COMMIT_SHA
+ --build-arg VCS_URL=$CI_PROJECT_URL
+ --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
+ .
+ - podman push $CI_REGISTRY_IMAGE:$CI_COMMIT_BRANCH
+