2018-02-13 03:38:52 +03:00
|
|
|
#!/bin/bash
|
2018-01-07 06:23:09 +03:00
|
|
|
|
2018-02-13 03:38:52 +03:00
|
|
|
root=$(cd `dirname $0`; pwd)
|
2018-03-11 21:25:53 +03:00
|
|
|
version=$1
|
2018-02-19 23:47:57 +03:00
|
|
|
commit=${TRAVIS_COMMIT:-`git rev-parse --verify HEAD`}
|
2018-02-19 23:30:17 +03:00
|
|
|
echo "Version: ${version:=`date -u +local-%Y%m%d-%H%M%S`}"
|
2018-01-07 06:23:09 +03:00
|
|
|
|
2018-03-06 03:19:15 +03:00
|
|
|
export CGO_ENABLED=0
|
2018-02-28 20:33:00 +03:00
|
|
|
|
|
|
|
for os in linux; do # add darwin and windows in the future
|
2018-02-13 03:38:52 +03:00
|
|
|
export GOOS=$os
|
|
|
|
mkdir -p $root/bin/$os
|
2018-02-19 23:30:17 +03:00
|
|
|
echo -n "Building droid for $os ..."
|
2018-02-28 20:33:00 +03:00
|
|
|
go build -o $root/bin/$os/a01droid \
|
|
|
|
-ldflags "-X main.version=$version -X main.sourceCommit=$commit" \
|
|
|
|
github.com/Azure/adx-automation-agent/droid
|
|
|
|
go build -o $root/bin/$os/a01dispatcher \
|
|
|
|
-ldflags "-X main.version=$version -X main.sourceCommit=$commit" \
|
|
|
|
github.com/Azure/adx-automation-agent/dispatcher
|
2018-02-27 10:01:59 +03:00
|
|
|
chmod +x $root/bin/$os/a01droid
|
2018-02-28 20:33:00 +03:00
|
|
|
chmod +x $root/bin/$os/a01dispatcher
|
2018-02-19 23:30:17 +03:00
|
|
|
echo "Done."
|
2018-02-13 03:38:52 +03:00
|
|
|
done
|