From 55a1d488245add8f198727c54bb28ce7e72512d0 Mon Sep 17 00:00:00 2001 From: Owen Quinlan <46948241+BuyMyMojo@users.noreply.github.com> Date: Fri, 19 Nov 2021 22:09:36 +1100 Subject: [PATCH] change build scripts to work with TeamCity --- build-locate-id.sh => Locate ID/build-locate-id.sh | 7 ++++--- build-id-parser.sh => User ID Parser/build-id-parser.sh | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) rename build-locate-id.sh => Locate ID/build-locate-id.sh (74%) rename build-id-parser.sh => User ID Parser/build-id-parser.sh (73%) diff --git a/build-locate-id.sh b/Locate ID/build-locate-id.sh similarity index 74% rename from build-locate-id.sh rename to Locate ID/build-locate-id.sh index 6460d2e..a22405f 100755 --- a/build-locate-id.sh +++ b/Locate ID/build-locate-id.sh @@ -1,8 +1,9 @@ #!/usr/bin/env bash + go mod download -package="$PWD/Locate ID/LocateID.go" +package="./LocateID.go" package_split=(${package//\// }) package_name="LocateID" @@ -15,11 +16,11 @@ do GOOS=${platform_split[0]} GOARCH=${platform_split[1]} output_name=$package_name'-'$GOOS'-'$GOARCH - if [ $GOOS = "windows" ]; then + if [ "$GOOS" = "windows" ]; then output_name+='.exe' fi - env GOOS=$GOOS GOARCH=$GOARCH GOPATH="$PWD/Locate ID/" go build -o "./Locate ID/build/$output_name" $package + 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 diff --git a/build-id-parser.sh b/User ID Parser/build-id-parser.sh similarity index 73% rename from build-id-parser.sh rename to User ID Parser/build-id-parser.sh index 8f67a0f..18fb6b4 100755 --- a/build-id-parser.sh +++ b/User ID Parser/build-id-parser.sh @@ -2,7 +2,7 @@ go mod download -package="$PWD/User ID Parser/IdParser.go" +package="./IdParser.go" package_split=(${package//\// }) package_name="IdParser" @@ -15,11 +15,11 @@ do GOOS=${platform_split[0]} GOARCH=${platform_split[1]} output_name=$package_name'-'$GOOS'-'$GOARCH - if [ $GOOS = "windows" ]; then + if [ "$GOOS" = "windows" ]; then output_name+='.exe' fi - env GOOS=$GOOS GOARCH=$GOARCH GOPATH="$PWD/User ID Parser/" go build -o ./User ID Praser/build/$output_name $package + 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