@@ -5,7 +5,7 @@ CGO_ENABLED ?= 0
5
5
CGO_CFLAGS ?=
6
6
CGO_LDFLAGS ?=
7
7
BUILD_TAGS ?=
8
- VERSION ?=
8
+ TAG ?=
9
9
BIN_EXT ?=
10
10
DOCKER_REPOSITORY ?= mosuka
11
11
@@ -22,10 +22,10 @@ ifeq ($(GOARCH),)
22
22
GOARCH = $(shell go version | awk -F ' ' '{print $$NF}' | awk -F '/' '{print $$2}')
23
23
endif
24
24
25
- ifeq ($(VERSION ) ,)
26
- VERSION = latest
25
+ ifeq ($(TAG ) ,)
26
+ TAG = latest
27
27
endif
28
- LDFLAGS = -ldflags "-s -w -X \"github.com/mosuka/phalanx/version.Version=$(VERSION ) \""
28
+ LDFLAGS = -ldflags "-s -w -X \"github.com/mosuka/phalanx/version.Version=$(TAG ) \""
29
29
30
30
ifeq ($(GOOS ) ,windows)
31
31
BIN_EXT = .exe
@@ -47,7 +47,7 @@ show-env:
47
47
@echo " CGO_CFLAGS = $( CGO_CFLAGS) "
48
48
@echo " CGO_LDFLAGS = $( CGO_LDFLAGS) "
49
49
@echo " BUILD_TAGS = $( BUILD_TAGS) "
50
- @echo " VERSION = $( VERSION ) "
50
+ @echo " TAG = $( TAG ) "
51
51
@echo " BIN_EXT = $( BIN_EXT) "
52
52
@echo " LDFLAGS = $( LDFLAGS) "
53
53
@echo " PACKAGES = $( PACKAGES) "
@@ -97,24 +97,24 @@ docs:
97
97
.PHONY : tag
98
98
tag : show-env
99
99
@echo " >> tagging github"
100
- ifeq ($(VERSION ) ,$(filter $(VERSION ) ,latest master "") )
101
- @echo "please specify VERSION "
100
+ ifeq ($(TAG ) ,$(filter $(TAG ) ,latest master "") )
101
+ @echo "please specify TAG "
102
102
else
103
- git tag -a $(VERSION ) -m "Release $(VERSION )"
104
- git push origin $(VERSION )
103
+ git tag -a $(TAG ) -m "Release $(TAG )"
104
+ git push origin $(TAG )
105
105
endif
106
106
107
107
.PHONY : docker-build
108
108
docker-build : show-env
109
109
@echo " >> building docker container image"
110
- docker build -t $(DOCKER_REPOSITORY ) /phalanx:latest --build-arg VERSION =$(VERSION ) .
111
- docker tag $(DOCKER_REPOSITORY ) /phalanx:latest $(DOCKER_REPOSITORY ) /phalanx:$(VERSION )
110
+ docker build -t $(DOCKER_REPOSITORY ) /phalanx:latest --build-arg TAG =$(TAG ) .
111
+ docker tag $(DOCKER_REPOSITORY ) /phalanx:latest $(DOCKER_REPOSITORY ) /phalanx:$(TAG )
112
112
113
113
.PHONY : docker-push
114
114
docker-push : show-env
115
115
@echo " >> pushing docker container image"
116
116
docker push $(DOCKER_REPOSITORY ) /phalanx:latest
117
- docker push $(DOCKER_REPOSITORY ) /phalanx:$(VERSION )
117
+ docker push $(DOCKER_REPOSITORY ) /phalanx:$(TAG )
118
118
119
119
.PHONY : docker-clean
120
120
docker-clean :
0 commit comments