forked from hockeypuck/packaging
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare.bash
More file actions
executable file
·44 lines (31 loc) · 998 Bytes
/
prepare.bash
File metadata and controls
executable file
·44 lines (31 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash -ex
export DEBEMAIL="cmars@cmarstech.com"
export DEBFULLNAME="Casey Marshall"
export RELEASE_VERSION=2.0~rc2
export BUILD_PACKAGE=github.com/hockeypuck/server
### Set up GOPATH
export GOPATH=$(pwd)
for pkg in launchpad.net/godeps github.com/mitchellh/gox; do
go get ${pkg}
go install ${pkg}
done
go get -d -t ${BUILD_PACKAGE}/...
cd src/${BUILD_PACKAGE}
${GOPATH}/bin/godeps -u dependencies.tsv
export SHORTHASH=$(git log -1 --pretty=format:%h)
export LONGHASH=$(git log -1 --pretty=format:%H)
export HEXDATE=$(date +%s)
### Set up webroot
cd ${GOPATH}
mkdir -p instroot/var/lib/hockeypuck
cd instroot/var/lib/hockeypuck
if [ ! -d www ]; then
git clone https://github.com/hockeypuck/webroot.git www
fi
# TODO: set webroot revision?
# Get our current and last built revision
export LTS_SERIES="precise trusty"
export PACKAGE_VERSION="${RELEASE_VERSION}~${HEXDATE}+${SHORTHASH}"
cd ${GOPATH}
echo "$LONGHASH" > version-git-commit
echo "$PACKAGE_VERSION" > version-release