1
1
BIN_DIR =_output/bin
2
2
CAT_CMD =$(if $(filter $(OS ) ,Windows_NT) ,type,cat)
3
- RELEASE_VER: =
3
+ RELEASE_VER: =$( shell git describe --tags --abbrev=0)
4
4
CURRENT_DIR =$(shell pwd)
5
5
GIT_BRANCH: =$(shell git symbolic-ref --short HEAD 2>&1 | grep -v fatal)
6
+ TAG: =
6
7
# define the GO_BUILD_ARGS if you need to pass additional arguments to the go build
7
8
GO_BUILD_ARGS? =
8
9
@@ -22,26 +23,6 @@ CLIENT_GEN ?= $(LOCALBIN)/client-gen
22
23
LISTER_GEN ?= $(LOCALBIN ) /lister-gen
23
24
INFORMER_GEN ?= $(LOCALBIN ) /informer-gen
24
25
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
-
45
26
.PHONY : print-global-variables
46
27
47
28
# Build the controller executable for use in docker image build
@@ -184,7 +165,6 @@ push-images: verify-tag-name
184
165
ifeq ($(strip $(quay_repository ) ) ,)
185
166
$(info No registry information provided. To push images to a docker registry please set)
186
167
$(info environment variables: quay_repository, quay_token, and quay_id. Environment)
187
- $(info variables do not need to be set for github Travis CICD.)
188
168
else
189
169
$(info Log into quay)
190
170
docker login quay.io -u ${quay_id} --password ${quay_token}
193
173
$(info Push the docker image to registry)
194
174
docker push ${quay_repository}/mcad-controller:${TAG}
195
175
ifeq ($(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
199
179
endif
200
180
ifneq ($(TAG :release-v% =% ),$(TAG ) )
201
181
$(info Update the `stable` tag to point `latest` release image)
0 commit comments