File tree Expand file tree Collapse file tree 2 files changed +60
-1
lines changed Expand file tree Collapse file tree 2 files changed +60
-1
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package tob
33const (
44 // Version number
55
6- Version = "1.1 .0"
6+ Version = "1.2 .0"
77
88 // OK service status
99 OK = "OK"
You can’t perform that action at this time.
0 commit comments