Commit 543773f3 authored by Michał Kępień's avatar Michał Kępień
Browse files

Only push "production" QCOW2 images from master

Use a "staging" registry for QCOW2 images in a similar spirit as for its
Docker counterpart - only update QCOW2 images in the main registry when
a CI job is run for the "master" branch.  This allows us to experiment
freely with the build process using custom branches, merge requests,
etc., without any risk of affecting GitLab CI results.
parent 494a7c88
......@@ -62,7 +62,7 @@ website-rsync_ssh_curl:
docker build --no-cache -t "$(CI_REGISTRY_IMAGE)/$(CI_REGISTRY_NAME)" "$(SOURCE_DIR)"
docker push "$(CI_REGISTRY_IMAGE)/$(CI_REGISTRY_NAME)"
# Only push into the main image registry when built in the master branch
# Only push to the main image registry when building from the "master" branch
CI_REGISTRY_PREFIX ?= bind9-staging
ifneq (,$(CI_COMMIT_REF_NAME))
ifeq ($(CI_COMMIT_REF_NAME),$(CI_DEFAULT_BRANCH))
......
......@@ -20,7 +20,15 @@ all: $(TARGETS)
.PHONY: $(TARGETS)
$(TARGETS): CI_REGISTRY_NAME = qcow2:$@
# Only push to the main image registry when building from the "master" branch
CI_REGISTRY_PREFIX ?= qcow2-staging
ifneq (,$(CI_COMMIT_REF_NAME))
ifeq ($(CI_COMMIT_REF_NAME),$(CI_DEFAULT_BRANCH))
CI_REGISTRY_PREFIX := qcow2
endif
endif
$(TARGETS): CI_REGISTRY_NAME = $(CI_REGISTRY_PREFIX):$@
$(TARGETS): QCOW2_IMAGE = $@
$(TARGETS): VENDOR = $(word 1,$(subst -, ,$@))
$(TARGETS): VERSION = $(word 2,$(subst -, ,$@))
......
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