Skip to content

Commit a5ea238

Browse files
committed
Add github release target
1 parent 760d170 commit a5ea238

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ _testmain.go
2525
*.prof
2626

2727
# Created by .ignore support plugin (hsz.mobi)
28+
29+
release/elastic-etcd

docker/Dockerfile renamed to Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ MAINTAINER Dr. Stefan Schimanski <[email protected]>
33

44
RUN apk add -U ca-certificates && rm -rf /var/cache/apk/*
55

6-
COPY elastic-etcd /elastic-etcd
6+
COPY release/elastic-etcd /elastic-etcd
77

88
CMD ["/elastic-etcd", "--help"]

Makefile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ SHELL=/bin/bash
22
CMD=elastic-etcd
33
GOBUILD=go build
44
REPOSITORY=sttts
5+
VERSION=$(shell git describe --always --tags --dirty)
56

67
default: all
78

@@ -38,13 +39,18 @@ check: gofmt gometalinter
3839
clean:
3940
rm -f $(CMD) docker/elastic-etcd
4041

41-
.PHONY: docker/elastic-etcd
42-
docker/elastic-etcd:
43-
cd docker && GOOS=linux go build github.com/sttts/elastic-etcd/cmd/elastic-etcd
42+
.PHONY: release/elastic-etcd
43+
release/elastic-etcd:
44+
mkdir -p release
45+
cd release && GOOS=linux go build github.com/sttts/elastic-etcd/cmd/elastic-etcd
46+
.PHONY: release
47+
release: release/elastic-etcd
48+
go get github.com/aktau/github-release
49+
github-release upload -u sttts --repo elastic-etcd --tag $(VERSION) --file release/elastic-etcd --name elastic-etcd
4450

4551
.PHONY: docker
46-
docker: docker/elastic-etcd
47-
docker build -t $(REPOSITORY)/elastic-etcd docker
52+
docker: release/elastic-etcd
53+
docker build -t $(REPOSITORY)/elastic-etcd .
4854

4955
push: docker
5056
docker push $(REPOSITORY)/elastic-etcd

0 commit comments

Comments
 (0)