diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4f17425 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +NAME:=$(shell basename $$PWD) +ARCH:=$(shell uname -m) +REPO:=$(shell git config --get remote.origin.url | perl -ne 'm{github.com[:/](.+/[^.]+)}; print $$1') +VERSION=0.0.2 + +build: + go build + +build_linux: + docker-machine start || true + bash -c 'eval $$(docker-machine env) ; rocker build --no-garbage' + +release: build build_linux + rm -rf release && mkdir release + mkdir -p build/Darwin && mv $(NAME) build/Darwin + tar -zcf release/$(NAME)_$(VERSION)_darwin_$(ARCH).tgz -C build/Darwin $(NAME) + tar -zcf release/$(NAME)_$(VERSION)_linux_$(ARCH).tgz -C build/Linux $(NAME) + gh-release create $(REPO) $(VERSION) master + +.PHONY: release build build_linux diff --git a/Rockerfile b/Rockerfile index faaf157..06bad18 100644 --- a/Rockerfile +++ b/Rockerfile @@ -4,5 +4,6 @@ WORKDIR /go/src/github.com/tulip/terraform-provider-twilio ATTACH ["/bin/bash"] RUN go get TAG terraform-provider-twilio-buildenv -RUN go build +RUN mkdir -p build/Linux +RUN go build -o build/Linux/terraform-provider-twilio