Skip to content

Commit 0c45d38

Browse files
committed
script: add package_http_agent
1 parent 7d31639 commit 0c45d38

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

scripts/package_http_agent.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/sh
2+
3+
check_err()
4+
{
5+
if [ "$1" -ne "0" ]; then
6+
echo "Error # ${1} : ${2}"
7+
exit ${1}
8+
fi
9+
}
10+
11+
package()
12+
{
13+
VERSION=$1
14+
OSNAME="linux"
15+
16+
if [ -z "$VERSION" ]; then
17+
echo "$0 require version argument"
18+
return 1
19+
fi
20+
21+
echo "packaging tob-http-agent version $VERSION"
22+
23+
echo "packaging for Apple's OSX"
24+
make build-http-agent-osx
25+
tar -czvf tob-http-agent-${VERSION}.darwin-amd64.tar.gz tob-http-agent
26+
rm tob-http-agent
27+
28+
echo "packaging for Linux"
29+
make build-http-agent-linux
30+
tar -czvf tob-http-agent-${VERSION}.linux-amd64.tar.gz tob-http-agent
31+
rm tob-http-agent
32+
33+
echo "generate SHA256 checksum ..."
34+
35+
if [ $(uname) = "Darwin" ]; then
36+
OSNAME="darwin"
37+
fi
38+
39+
if [ "$OSNAME" = "linux" ]; then
40+
sha256sum tob-http-agent-${VERSION}.darwin-amd64.tar.gz >> tob-http-agent-sha256sums.txt
41+
sha256sum tob-http-agent-${VERSION}.linux-amd64.tar.gz >> tob-http-agent-sha256sums.txt
42+
else
43+
shasum -a 256 tob-http-agent-${VERSION}.darwin-amd64.tar.gz >> tob-http-agent-sha256sums.txt
44+
shasum -a 256 tob-http-agent-${VERSION}.linux-amd64.tar.gz >> tob-http-agent-sha256sums.txt
45+
fi
46+
47+
return 0
48+
}
49+
50+
package "$@"
51+
check_err $? "package_http_agent returned error"
52+
53+
# How to run this script
54+
55+
# always execute package_http_agent.sh from root project folder
56+
# ./scripts/package_http_agent.sh YOUR_NEW_VERSION_HERE
57+
58+
# eg:
59+
# ./scripts/package_http_agent.sh 1.0.0

tob.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package tob
33
const (
44
// Version number
55

6-
Version = "1.1.0"
6+
Version = "1.2.0"
77

88
// OK service status
99
OK = "OK"

0 commit comments

Comments
 (0)