Skip to content

Commit f86dcb1

Browse files
Simon HirstGitHub Enterprise
authored andcommitted
Merge pull request #251 from mq-cloudpak/sjh-fake-master-pushing
Push fake master builds to different namespace
2 parents bebb8e1 + ae82196 commit f86dcb1

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
###############################################################################
1919

2020
include config.env
21+
include source-branch.env
2122

2223
# RELEASE shows what release of the container code has been built
2324
RELEASE ?=
@@ -115,6 +116,13 @@ else ifeq "$(ARCH)" "s390x"
115116
MQ_ARCHIVE_ARCH=S390X
116117
endif
117118

119+
# If this is a fake master build, push images to alternative location (pipeline wont consider these images GA candidates)
120+
ifeq "$(TRAVIS)" "true"
121+
ifneq "$(MAIN_BRANCH)" "$(SOURCE_BRANCH)"
122+
MQ_DELIVERY_REGISTRY_NAMESPACE="master-fake"
123+
endif
124+
endif
125+
118126
# LTS_TAG is the tag modifier for an LTS container build
119127
LTS_TAG=
120128
ifeq "$(LTS)" "true"
@@ -462,13 +470,19 @@ pull-mq-archive-dev:
462470

463471
.PHONY: push-advancedserver
464472
push-advancedserver:
473+
@if [ $(MQ_DELIVERY_REGISTRY_NAMESPACE) = "master-fake" ]; then\
474+
echo "Detected fake master build. Note that the push destination is set to the fake master namespace: $(MQ_DELIVERY_REGISTRY_FULL_PATH)";\
475+
fi
465476
$(info $(SPACER)$(shell printf $(TITLE)"Push production image to $(MQ_DELIVERY_REGISTRY_FULL_PATH)"$(END)))
466477
$(COMMAND) login $(MQ_DELIVERY_REGISTRY_HOSTNAME) -u $(MQ_DELIVERY_REGISTRY_USER) -p $(MQ_DELIVERY_REGISTRY_CREDENTIAL)
467478
$(COMMAND) tag $(MQ_IMAGE_ADVANCEDSERVER)\:$(MQ_TAG) $(MQ_DELIVERY_REGISTRY_FULL_PATH)/$(MQ_IMAGE_FULL_RELEASE_NAME)
468479
$(COMMAND) push $(MQ_DELIVERY_REGISTRY_FULL_PATH)/$(MQ_IMAGE_FULL_RELEASE_NAME)
469480

470481
.PHONY: push-devserver
471482
push-devserver:
483+
@if [ $(MQ_DELIVERY_REGISTRY_NAMESPACE) = "master-fake" ]; then\
484+
echo "Detected fake master build. Note that the push destination is set to the fake master namespace: $(MQ_DELIVERY_REGISTRY_FULL_PATH)";\
485+
fi
472486
$(info $(SPACER)$(shell printf $(TITLE)"Push developer image to $(MQ_DELIVERY_REGISTRY_FULL_PATH)"$(END)))
473487
$(COMMAND) login $(MQ_DELIVERY_REGISTRY_HOSTNAME) -u $(MQ_DELIVERY_REGISTRY_USER) -p $(MQ_DELIVERY_REGISTRY_CREDENTIAL)
474488
$(COMMAND) tag $(MQ_IMAGE_DEVSERVER)\:$(MQ_TAG) $(MQ_DELIVERY_REGISTRY_FULL_PATH)/$(MQ_IMAGE_DEV_FULL_RELEASE_NAME)

source-branch.env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
###########################################################################################################################################################
2+
3+
# SOURCE_BRANCH is the repository branch name for this release stream.
4+
# It should be updated when a new release fork is created but not for testing of personal builds or pre-fork updates.
5+
SOURCE_BRANCH ?= 'private-master'
6+
7+
###########################################################################################################################################################

0 commit comments

Comments
 (0)