diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a32a41b..12128e13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## [1.1.1](https://github.com/grammarly/rocker/tree/1.1.1) + +[Full Changelog](https://github.com/grammarly/rocker/compare/1.1.0...1.1.1) + +**Merged pull requests:** + +- Use git branch names as tags for docker images [\#70](https://github.com/grammarly/rocker/pull/70) ([romank87](https://github.com/romank87)) + ## [1.1.0](https://github.com/grammarly/rocker/tree/1.1.0) (2016-01-29) [Full Changelog](https://github.com/grammarly/rocker/compare/1.0.1...1.1.0) diff --git a/README.md b/README.md index 94395060..9c5117ce 100644 --- a/README.md +++ b/README.md @@ -49,17 +49,17 @@ Go to the [releases](https://github.com/grammarly/rocker/releases) section and d Something like this: ```bash -curl -SL https://github.com/grammarly/rocker/releases/download/1.0.1/rocker-1.0.1_darwin_amd64.tar.gz | tar -xzC /usr/local/bin && chmod +x /usr/local/bin/rocker +curl -SL https://github.com/grammarly/rocker/releases/download/1.1.0/rocker-1.1.0-darwin_amd64.tar.gz | tar -xzC /usr/local/bin && chmod +x /usr/local/bin/rocker ``` ### Building locally -`make` will produce the `bin/rocker` binary. +You can build rocker locally assuming [$GOPATH](https://github.com/golang/go/wiki/GOPATH) env variable is set: ```bash -make -make install +GO15VENDOREXPERIMENT=1 go get github.com/grammarly/rocker ``` +binary will be available at $GOPATH/bin/rocker ### Getting help, usage: diff --git a/Rockerfile b/Rockerfile index 4c0407c9..7260e5ff 100644 --- a/Rockerfile +++ b/Rockerfile @@ -1,9 +1,8 @@ FROM golang:1.5.1 -{{ assert .Version }} -{{ $stable := "0.2.3" }} -{{ $beta := "0.2.4" }} -{{ $v1 := "1." }} +{{ $commit := (or .Env.GIT_COMMIT "") }} +{{ $branch := (or .Env.GIT_BRANCH "none") }} +{{ $version:= (or .Version "local") }} ADD . /go/src/github.com/grammarly/rocker WORKDIR /go/src/github.com/grammarly/rocker @@ -22,10 +21,9 @@ RUN make test ATTACH ["bash"] RUN \ - TIME=$(TZ=GMT date "+%Y-%m-%d_%H:%M_GMT") \ go build \ -a -installsuffix cgo \ - -ldflags "-X main.Version={{ .Version }} -X main.GitCommit=$commit -X main.GitBranch=$branch -X main.BuildTime=$TIME" \ + -ldflags "-X main.Version={{$version}} -X main.GitCommit={{$commit}} -X main.GitBranch={{$branch}} -X main.BuildTime=$(TZ=GMT date '+%Y-%m-%d_%H:%M_GMT')" \ -v -o /bin/rocker EXPORT /bin/rocker @@ -47,12 +45,9 @@ ENV PATH=/opt/rocker/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin CMD ["/opt/rocker/bin/rocker"] -PUSH dockerhub.grammarly.io/rocker:{{ .Version }} +PUSH dockerhub.grammarly.io/rocker:{{ $branch }} -{{ if hasPrefix .Version $stable }} - PUSH dockerhub.grammarly.io/rocker:stable -{{ else if hasPrefix .Version $beta }} - PUSH dockerhub.grammarly.io/rocker:beta -{{ else if hasPrefix .Version $v1 }} - PUSH dockerhub.grammarly.io/rocker:v1 +{{ if and (ne $version "local") (eq $branch "master") }} + PUSH dockerhub.grammarly.io/rocker:{{ $version }} {{ end }} + diff --git a/VERSION b/VERSION index 9084fa2f..524cb552 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.0 +1.1.1