File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed
Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -26,4 +26,3 @@ dockers:
2626 dockerfile : Dockerfile
2727 image_templates :
2828 - " nuvo/{{.ProjectName}}:{{ .Tag }}"
29- - " nuvo/{{.ProjectName}}:latest"
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ services:
99deploy :
1010- provider : script
1111 skip_cleanup : true
12- script : docker login -u $DOCKER_USER -p $DOCKER_PASSWORD && curl -sL https://git.io/goreleaser | bash
12+ script : curl -sL https://git.io/goreleaser | bash
1313 on :
1414 tags : true
1515 condition : $TRAVIS_OS_NAME = linux
Original file line number Diff line number Diff line change @@ -4,8 +4,11 @@ GIT_TAG := $(shell git describe --tags --always)
44GIT_COMMIT := $(shell git rev-parse --short HEAD)
55LDFLAGS := "-X main.GitTag=${GIT_TAG} -X main.GitCommit=${GIT_COMMIT}"
66DIST := $(CURDIR ) /dist
7+ DOCKER_USER := $(shell printenv DOCKER_USER)
8+ DOCKER_PASSWORD := $(shell printenv DOCKER_PASSWORD)
9+ TRAVIS := $(shell printenv TRAVIS)
710
8- all : bootstrap build
11+ all : bootstrap build docker push
912
1013fmt :
1114 go fmt ./pkg/... ./cmd/...
1720build : fmt vet
1821 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags $(LDFLAGS ) -o bin/cain cmd/cain.go
1922
23+ # Build cain docker image
24+ docker : fmt vet
25+ cp bin/cain cain
26+ docker build -t nuvo/cain:latest .
27+ rm cain
28+
29+
30+ # Push will only happen in travis ci
31+ push :
32+ ifdef TRAVIS
33+ ifdef DOCKER_USER
34+ ifdef DOCKER_PASSWORD
35+ docker login -u $(DOCKER_USER) -p $(DOCKER_PASSWORD)
36+ docker push nuvo/cain:latest
37+ endif
38+ endif
39+ endif
40+
2041bootstrap :
2142ifndef HAS_DEP
2243 wget -q -O $(GOPATH)/bin/dep https://github.com/golang/dep/releases/download/$(DEP_VERSION)/dep-linux-amd64
You can’t perform that action at this time.
0 commit comments