Skip to content

Commit

Permalink
chore(ci): limit cross build targets
Browse files Browse the repository at this point in the history
Limit cross builds to linux/amd64 linux/386 darwin/amd64
  • Loading branch information
adamreese committed Oct 10, 2016
1 parent b7abaa3 commit 729f9b8
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
DOCKER_REGISTRY ?= gcr.io
IMAGE_PREFIX ?= kubernetes-helm
SHORT_NAME ?= tiller
TARGETS = darwin/amd64 linux/amd64 linux/386
DIST_DIRS = find * -type d -exec

# go option
GO ?= go
Expand All @@ -12,7 +14,6 @@ LDFLAGS :=
GOFLAGS :=
BINDIR := $(CURDIR)/bin
BINARIES := helm tiller
DIST_DIRS := find * -type d -exec

.PHONY: all
all: build
Expand All @@ -24,26 +25,23 @@ build:
# usage: make build-cross dist VERSION=v2.0.0-alpha.3
.PHONY: build-cross
build-cross:
gox -output="_dist/{{.OS}}-{{.Arch}}/{{.Dir}}" -os="darwin linux windows" -arch="amd64 386" $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/helm
gox -output="_dist/{{.OS}}-{{.Arch}}/{{.Dir}}" -osarch='$(TARGETS)' $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/helm

.PHONY: dist
dist:
( \
cd _dist && \
$(DIST_DIRS) cp ../LICENSE {} \; && \
$(DIST_DIRS) cp ../README.md {} \; && \
$(DIST_DIRS) tar -zcf helm-${VERSION}-{}.tar.gz {} \; && \
$(DIST_DIRS) zip -r helm-${VERSION}-{}.zip {} \; \
$(DIST_DIRS) tar -zcf helm-${GIT_TAG}-{}.tar.gz {} \; && \
$(DIST_DIRS) zip -r helm-${GIT_TAG}-{}.zip {} \; \
)

.PHONY: checksum
checksum:
( \
cd _dist && \
for f in ./*.{tar.gz,zip} ; do \
shasum -a 256 "$${f}" | awk '{print $$1}' > "$${f}.sha256" ; \
done \
)
for f in _dist/*.{gz,zip} ; do \
shasum -a 256 "$${f}" | awk '{print $$1}' > "$${f}.sha256" ; \
done

.PHONY: check-docker
check-docker:
Expand Down

0 comments on commit 729f9b8

Please sign in to comment.