forked from cloudius-systems/capstan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-dist
executable file
·25 lines (20 loc) · 938 Bytes
/
make-dist
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
#!/bin/bash
package=github.com/cloudius-systems/capstan
git_version=$(scripts/version)
IFS='-' read -ra version_parts <<< "$git_version"
version="${version_parts[0]}"
OLDIFS=$IFS
IFS=' '; set -- $(go version)
IFS='.'; set -- $3
IFS=$OLDIFS
if [ $2 -gt 4 ]; then
link_operator="="
else
link_operator=" "
fi
echo "Building Linux amd64"
env GOOS=linux GOARCH=amd64 go build -a -ldflags "-X main.VERSION$link_operator'$version' -w -s" -tags netgo -v -o dist/linux_amd64/capstan $package
s3cmd put --acl-public --guess-mime-type ./dist/linux_amd64/capstan s3://mikelangelo-capstan/capstan/$version/linux_amd64/capstan
echo "Building Darwin amd64"
env GOOS=darwin GOARCH=amd64 go build -a -ldflags "-X main.VERSION$link_operator'$version' -w -s" -tags netgo -v -o dist/darwin_amd64/capstan $package
s3cmd put --acl-public --guess-mime-type ./dist/darwin_amd64/capstan s3://mikelangelo-capstan/capstan/$version/darwin_amd64/capstan