change build scripts to work with TeamCity
This commit is contained in:
parent
69023df428
commit
55a1d48824
2 changed files with 7 additions and 6 deletions
27
User ID Parser/build-id-parser.sh
Executable file
27
User ID Parser/build-id-parser.sh
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
go mod download
|
||||
|
||||
package="./IdParser.go"
|
||||
|
||||
package_split=(${package//\// })
|
||||
package_name="IdParser"
|
||||
|
||||
platforms=("windows/amd64" "windows/386" "linux/amd64" "linux/386" "linux/arm64" "linux/arm")
|
||||
|
||||
for platform in "${platforms[@]}"
|
||||
do
|
||||
platform_split=(${platform//\// })
|
||||
GOOS=${platform_split[0]}
|
||||
GOARCH=${platform_split[1]}
|
||||
output_name=$package_name'-'$GOOS'-'$GOARCH
|
||||
if [ "$GOOS" = "windows" ]; then
|
||||
output_name+='.exe'
|
||||
fi
|
||||
|
||||
env GOOS="$GOOS" GOARCH=$GOARCH go build -o "./build/$output_name" $package
|
||||
if [ $? -ne 0 ]; then
|
||||
echo 'An error has occurred! Aborting the script execution...'
|
||||
exit 1
|
||||
fi
|
||||
done
|
Reference in a new issue