diff --git a/Dockerfile b/Dockerfile index 22cb47734d..afd5f9cbc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ FROM golang:1.3-cross RUN go get github.com/mitchellh/gox +RUN go get github.com/aktau/github-release ENV GOPATH /go/src/github.com/docker/machine/Godeps/_workspace:/go WORKDIR /go/src/github.com/docker/machine ADD . /go/src/github.com/docker/machine diff --git a/script/build b/script/build index 32a5badaac..8feb1cf205 100755 --- a/script/build +++ b/script/build @@ -1,4 +1,5 @@ #!/bin/sh set -e +rm -f machine_* docker build -t docker-machine . exec docker run --rm -v `pwd`:/go/src/github.com/docker/machine docker-machine gox -os="darwin linux windows" diff --git a/script/release b/script/release new file mode 100755 index 0000000000..7d4e1dc0e4 --- /dev/null +++ b/script/release @@ -0,0 +1,32 @@ +#!/bin/bash +set -e +if [ -z "$1" ]; then + echo "Pass the version number as the first arg. E.g.: script/release 1.2.3" + exit 1 +fi +VERSION=$1 +if [ -z "$GITHUB_TOKEN" ]; then + echo "GITHUB_TOKEN must be set for github-release" + exit 1 +fi + +script/build +git tag $VERSION +git push --tags +docker run --rm -e GITHUB_TOKEN docker-machine github-release release \ + --user docker \ + --repo machine \ + --tag $VERSION \ + --name $VERSION \ + --description "" \ + --pre-release \ +for BINARY in machine_*; do + docker run --rm -e GITHUB_TOKEN -v `pwd`:/go/src/github.com/docker/machine \ + docker-machine github-release upload \ + --user docker \ + --repo machine \ + --tag $VERSION \ + --name $BINARY \ + --file $BINARY +done +