30 lines
803 B
Bash
Executable File
30 lines
803 B
Bash
Executable File
#!/bin/bash
|
|
DIR="$(dirname "$(readlink -f "$0")")"
|
|
export GOPATH=$DIR
|
|
# set a specific release
|
|
# REL=v2.0.0
|
|
PLUGINS=''
|
|
while IFS= read -r line; do
|
|
[ $line ] && echo Using Plugin: $line
|
|
PLUGINS=`[ $line ] && echo $PLUGINS' --with '$line`
|
|
done < $DIR/plugins.txt
|
|
# reading builds file
|
|
cat $DIR/builds.txt | while read GOOS GOARCH GOARM;
|
|
do
|
|
GOOS=${GOOS:-linux}
|
|
GOARCH=${GOARCH:-amd64}
|
|
BIN_NAME=$GOOS-$GOARCH`[ $GOARM ] && echo -$GOARM`
|
|
echo deleting any old executable $BIN_NAME
|
|
[ -f $DIR/bin/$BIN_NAME ] && rm $DIR/bin/$BIN_NAME
|
|
echo Building binary $BIN_NAME
|
|
export GOOS=$GOOS
|
|
export GOARCH=$GOARCH
|
|
[ $GOARM ] && export GOARM=$GOARM
|
|
env | grep GO
|
|
$DIR/bin/xcaddy build $REL \
|
|
--output $DIR/bin/$BIN_NAME \
|
|
$PLUGINS
|
|
echo ...done building
|
|
[ -f $DIR/BIN/$ARCH ] && $DIR/bin/$ARCH version
|
|
done
|