Add release script

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
This commit is contained in:
Ben Firshman 2014-12-09 16:45:23 -08:00
parent 4e719d4d02
commit d95e4b3a6f
3 changed files with 34 additions and 0 deletions

View File

@ -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

View File

@ -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"

32
script/release Executable file
View File

@ -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