11BIN_DIR =_output/bin
22CAT_CMD =$(if $(filter $(OS ) ,Windows_NT) ,type,cat)
3- RELEASE_VER: =
3+ RELEASE_VER: =$( shell git describe --tags --abbrev=0)
44CURRENT_DIR =$(shell pwd)
55GIT_BRANCH: =$(shell git symbolic-ref --short HEAD 2>&1 | grep -v fatal)
6+ TAG: =
67# define the GO_BUILD_ARGS if you need to pass additional arguments to the go build
78GO_BUILD_ARGS? =
89
@@ -22,26 +23,6 @@ CLIENT_GEN ?= $(LOCALBIN)/client-gen
2223LISTER_GEN ?= $(LOCALBIN ) /lister-gen
2324INFORMER_GEN ?= $(LOCALBIN ) /informer-gen
2425
25- # Reset branch name if this a Travis CI environment
26- ifneq ($(strip $(TRAVIS_BRANCH ) ) ,)
27- GIT_BRANCH:=${TRAVIS_BRANCH}
28- endif
29-
30- TAG: =$(shell echo "")
31- # Check for git repository id sent by Travis-CI
32- ifneq ($(strip $(git_repository_id ) ) ,)
33- TAG:=${TAG}${git_repository_id}-
34- endif
35-
36- # Check for current branch name and update 'RELEASE_VER' and 'TAG'
37- ifneq ($(strip $(GIT_BRANCH ) ) ,)
38- RELEASE_VER:= $(shell git describe --tags --abbrev=0)
39- TAG:=${TAG}${GIT_BRANCH}
40- # replace invalid characters that might exist in the branch name
41- TAG:=$(shell echo ${TAG} | sed 's/[^a-zA-Z0-9]/-/g')
42- TAG:=${TAG}-${RELEASE_VER}
43- endif
44-
4526.PHONY : print-global-variables
4627
4728# Build the controller executable for use in docker image build
@@ -184,7 +165,6 @@ push-images: verify-tag-name
184165ifeq ($(strip $(quay_repository ) ) ,)
185166 $(info No registry information provided. To push images to a docker registry please set)
186167 $(info environment variables: quay_repository, quay_token, and quay_id. Environment)
187- $(info variables do not need to be set for github Travis CICD.)
188168else
189169 $(info Log into quay)
190170 docker login quay.io -u ${quay_id} --password ${quay_token}
193173 $(info Push the docker image to registry)
194174 docker push ${quay_repository}/mcad-controller:${TAG}
195175ifeq ($(strip $(git_repository_id ) ) ,main)
196- $(info Update the `latest ` tag when built from `main`)
197- docker tag mcad-controller:${TAG} ${quay_repository}/mcad-controller:latest
198- docker push ${quay_repository}/mcad-controller:latest
176+ $(info Update the `dev ` tag when built from `main`)
177+ docker tag mcad-controller:${TAG} ${quay_repository}/mcad-controller:dev
178+ docker push ${quay_repository}/mcad-controller:dev
199179endif
200180ifneq ($(TAG :release-v% =% ),$(TAG ) )
201181 $(info Update the `stable` tag to point `latest` release image)
0 commit comments