-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tobias Schwab
committed
Aug 25, 2013
1 parent
d4fdeda
commit 28ed533
Showing
4 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
bin | ||
metrix | ||
releases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package main | ||
|
||
const timeFormat = "2006-01-02 15:04:05Z" | ||
const VERSION = "0.1.1" | ||
|
||
var ( | ||
GITCOMMIT string | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# to be called with | ||
# GOOS=linux GOARCH=amd64 bash ./scripts/release.sh | ||
|
||
BIN_NAME=metrix | ||
|
||
# revision and version | ||
PROJECT_ROOT=$(grealpath $(dirname $0)/../) | ||
GIT_COMMIT=$(git rev-parse --short HEAD) | ||
GIT_STATUS=$(test -n "`git status --porcelain`" && echo "+CHANGES" || echo "") | ||
GIT_REV=$GIT_COMMIT$GIT_STATUS | ||
VERSION=$(grep VERSION $PROJECT_ROOT/constants.go | cut -d '"' -f 2) | ||
|
||
# dirs and paths | ||
RELEASE_PATH=$PROJECT_ROOT/releases/$GIT_REV | ||
NAME=$BIN_NAME-v$VERSION.$GOOS.$GOARCH | ||
RELEASE_TMP_DIR=$RELEASE_PATH/$NAME | ||
RELEASE_BIN=$RELEASE_TMP_DIR/$BIN_NAME | ||
|
||
echo "building in $RELEASE_PATH" | ||
mkdir -p $RELEASE_TMP_DIR | ||
go build -a -ldflags "-X main.GITCOMMIT $GIT_REV" -o $RELEASE_BIN | ||
chmod a+x $RELEASE_BIN | ||
cd $(dirname $RELEASE_BIN) && tar cfz $RELEASE_PATH/$NAME.tar.gz $BIN_NAME | ||
rm -Rf $RELEASE_TMP_DIR |