Skip to content

Commit

Permalink
Add release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
moznion committed May 21, 2016
1 parent 49c119f commit 130c167
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin/*
!bin/.gitkeep
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build:
docker run --rm -v "$(PWD)":/go/src/github.com/moznion/resque_exporter -w /go/src/github.com/moznion/resque_exporter golang:1.6 bash author/build.sh $(VERSION)

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ Note

This exporter also supports resque compatible job-queue engine (e.g. [jesque](https://github.com/gresrun/jesque)).

[For developers] How to build to release
--

Execute `make build VERSION=${version}` on __Docker available__ environment. Built binaries will be on `bin` directory.

License
--

Expand Down
25 changes: 25 additions & 0 deletions author/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

VER=$1
if [ -z "$1" ] ; then
echo 'Missing version'
exit 1
fi

REV=$(git rev-parse --verify HEAD)
PACKAGE="github.com/moznion/resque_exporter"

go get -v gopkg.in/yaml.v2
go get -v gopkg.in/redis.v3
go get -v github.com/mkideal/cli
go get -v github.com/prometheus/client_golang/prometheus

for GOOS in darwin linux; do
for GOARCH in 386 amd64; do
export GOOS
export GOARCH
go build -v -ldflags "-X ${PACKAGE}.rev=$REV -X ${PACKAGE}.ver=$VER" \
-o bin/resque_exporter-$GOOS-$GOARCH cmd/resque_exporter/resque_exporter.go
done
done

Empty file added bin/.gitkeep
Empty file.

0 comments on commit 130c167

Please sign in to comment.