Skip to content
This repository was archived by the owner on Oct 20, 2023. It is now read-only.

Commit af08faf

Browse files
authored
Merge pull request #23 from michelleN/makefile
prepare Makefile for release
2 parents e53a9b2 + 2ab78ae commit af08faf

3 files changed

Lines changed: 56 additions & 0 deletions

File tree

Makefile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
TARGETS ?= darwin/amd64 linux/amd64 windows/amd64
2+
DIST_DIRS = find * -type d -exec
3+
4+
# go options
5+
BINDIR := $(CURDIR)/bin
6+
GO ?= go
7+
GOFLAGS :=
8+
TAGS :=
9+
LDFLAGS := -w -s
10+
11+
.PHONY: build
12+
build:
13+
GOBIN=$(BINDIR) $(GO) install $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' github.com/deislabs/smi-sdk-go/cmd/installer
14+
15+
.PHONY: build-cross
16+
build-cross: LDFLAGS += -extldflags "-static"
17+
build-cross:
18+
CGO_ENABLED=0 gox -parallel=3 \
19+
-output="_dist/{{.OS}}-{{.Arch}}/{{.Dir}}" \
20+
-osarch='$(TARGETS)' $(GOFLAGS) \
21+
$(if $(TAGS),-tags '$(TAGS)',) -ldflags '$(LDFLAGS)' \
22+
github.com/deislabs/smi-sdk-go/cmd/installer
23+
24+
.PHONY: checksum
25+
checksum:
26+
for f in _dist/*.{gz,zip} ; do \
27+
shasum -a 256 "$${f}" | awk '{print $$1}' > "$${f}.sha256" ; \
28+
echo -n "Checksum: " && cat $${f}.sha256 ; \
29+
done
30+
31+
.PHONY: dist
32+
dist: build-cross
33+
dist:
34+
cd _dist && \
35+
$(DIST_DIRS) cp ../LICENSE {} \; && \
36+
$(DIST_DIRS) cp ../README.md {} \; && \
37+
$(DIST_DIRS) tar -zcf installer-${VERSION}-{}.tar.gz {} \; && \
38+
$(DIST_DIRS) zip -r installer-${VERSION}-{}.zip {} \; \
39+
40+
.PHONY: bootstrap
41+
bootstrap:
42+
go mod tidy
43+
44+
.PHONY: test
45+
test:
46+
go test -v ./...

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ require (
99
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
1010
github.com/google/btree v1.0.0 // indirect
1111
github.com/google/gofuzz v1.0.0 // indirect
12+
github.com/google/pprof v0.0.0-20190723021845-34ac40c74b70 // indirect
1213
github.com/googleapis/gnostic v0.2.0 // indirect
1314
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc // indirect
1415
github.com/hashicorp/golang-lru v0.5.1 // indirect
16+
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 // indirect
1517
github.com/json-iterator/go v1.1.6 // indirect
1618
github.com/kubernetes-client/go v0.0.0-20190516163813-075b33afc74f
1719
github.com/modern-go/reflect2 v1.0.1 // indirect
1820
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
1921
github.com/stretchr/testify v1.3.0
22+
golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1 // indirect
2023
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c // indirect
2124
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a // indirect
2225
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect

go.sum

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a
7272
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
7373
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
7474
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
75+
github.com/google/pprof v0.0.0-20190723021845-34ac40c74b70 h1:XTnP8fJpa4Kvpw2qARB4KS9izqxPS0Sd92cDlY3uk+w=
76+
github.com/google/pprof v0.0.0-20190723021845-34ac40c74b70/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
7577
github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
7678
github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g=
7779
github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
@@ -86,6 +88,8 @@ github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+
8688
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
8789
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
8890
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
91+
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c=
92+
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
8993
github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
9094
github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs=
9195
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
@@ -148,6 +152,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
148152
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
149153
go.opencensus.io v0.20.2 h1:NAfh7zF0/3/HqtMvJNZ/RFrSlCE6ZTlHmKfhL/Dm1Jk=
150154
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
155+
golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1 h1:A71BZbKSu+DtCNry/x5JKn20C+64DirDHmePEA8k0FY=
156+
golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4=
151157
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
152158
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
153159
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
@@ -260,6 +266,7 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
260266
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
261267
modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs=
262268
modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
269+
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
263270
sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
264271
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
265272
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=

0 commit comments

Comments
 (0)