5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-09-19 21:52:32 +00:00

Add branch name into repo name

This commit is contained in:
Neil Alexander 2018-03-02 22:36:22 +00:00 committed by GitHub
parent 3c1e00f23f
commit 674830799d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,15 +10,19 @@ then
exit -1
fi
PKGNAME=yggdrasil
PKGBRANCH=$(basename `git name-rev --name-only HEAD`)
if [ "$PKGBRANCH" = "master" ]; then PKGNAME=yggdrasil
else PKGNAME=yggdrasil-${PKGBRANCH}; fi
PKGARCH=${PKGARCH-amd64}
PKGVERSION=0.$(git rev-list HEAD --count 2>/dev/null | xargs printf "%04d")
PKGFILE=$PKGNAME-$PKGVERSION-$PKGARCH.deb
if [ $PKGARCH = "amd64" ]; then GOARCH=amd64 GOOS=linux ./build
elif [ $PKGARCH = "i386" ]; then GOARCH=386 GOOS=linux ./build
elif [ $PKGARCH = "mipsel" ]; then GOARCH=mipsle GOOS=linux ./build
elif [ $PKGARCH = "mips" ]; then GOARCH=mips64 GOOS=linux ./build
else
echo "Specify PKGARCH=amd64 or PKGARCH=i386"
echo "Specify PKGARCH=amd64,i386,mips,mipsel"
exit -1
fi