Skip to content

Commit

Permalink
remove debug output from filter command (#211)
Browse files Browse the repository at this point in the history
* remove debug output from filter command

* fix CGO_ENABLED env variable
  • Loading branch information
xorpaul authored Jan 19, 2023
1 parent 766ab35 commit 01fbdf0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 9 additions & 6 deletions build_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,20 @@ git push
echo "creating github release v${1}"
github-release release --user xorpaul --repo ${projectname} --tag v${1} --name "v${1}" --description "${2}"

export CGO_ENABLED=0
export BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S')
export BUILDVERSION=$(git describe --tags)
upx=`which upx`

if [ ${#upx} -gt 0 ]; then
echo "building and uploading ${projectname}-darwin-amd64-debug"
CGO_ENABLED=0 BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && env GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date
env GOOS=darwin GOARCH=amd64 go build -ldflags "-X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date
zip ${projectname}-darwin-amd64-debug.zip ${projectname}
github-release upload --user xorpaul --repo ${projectname} --tag v${1} --name "${projectname}-darwin-amd64-debug.zip" --file ${projectname}-darwin-amd64-debug.zip
fi

echo "building and uploading ${projectname}-darwin-amd64"
CGO_ENABLED=0 BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && env GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date
env GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date
if [ ${#upx} -gt 0 ]; then
$upx --brute ${projectname}
fi
Expand All @@ -52,13 +55,13 @@ github-release upload --user xorpaul --repo ${projectname} --tag v${

if [ ${#upx} -gt 0 ]; then
echo "building and uploading ${projectname}-darwin-arm64-debug"
CGO_ENABLED=0 BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && env GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date
env GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date
zip ${projectname}-darwin-arm64-debug.zip ${projectname}
github-release upload --user xorpaul --repo ${projectname} --tag v${1} --name "${projectname}-darwin-arm64-debug.zip" --file ${projectname}-darwin-arm64-debug.zip
fi

echo "building and uploading ${projectname}-darwin-arm64"
CGO_ENABLED=0 BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && env GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date
env GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date
if [ ${#upx} -gt 0 ]; then
$upx --brute ${projectname}
fi
Expand All @@ -70,13 +73,13 @@ github-release upload --user xorpaul --repo ${projectname} --tag v${

if [ ${#upx} -gt 0 ]; then
echo "building and uploading ${projectname}-linux-amd64-debug"
CGO_ENABLED=0 BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && go build -race -ldflags "-X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date && env ${projectname}_cachedir=/tmp/${projectname} ./${projectname} -config test.yaml -branch benchmark 2>&1
go build -race -ldflags "-X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date && env ${projectname}_cachedir=/tmp/${projectname} ./${projectname} -config test.yaml -branch benchmark 2>&1
zip ${projectname}-linux-amd64-debug.zip ${projectname}
github-release upload --user xorpaul --repo ${projectname} --tag v${1} --name "${projectname}-linux-amd64-debug.zip" --file ${projectname}-linux-amd64-debug.zip
fi

echo "building and uploading ${projectname}-linux-amd64"
CGO_ENABLED=0 BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') BUILDVERSION=$(git describe --tags) && go build -race -ldflags "-s -w -X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date && env ${projectname}_cachedir=/tmp/${projectname} ./${projectname} -config test.yaml -branch benchmark 2>&1
go build -race -ldflags "-s -w -X main.buildtime=${BUILDTIME} -X main.buildversion=${BUILDVERSION}" && date && env ${projectname}_cachedir=/tmp/${projectname} ./${projectname} -config test.yaml -branch benchmark 2>&1
if [ ${#upx} -gt 0 ]; then
$upx --brute ${projectname}
fi
Expand Down
4 changes: 3 additions & 1 deletion puppetfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,9 @@ func skipBasedOnFilterCommand(branch string, sourceName string, sa Source, workD
branchFilterCommand = strings.ReplaceAll(branchFilterCommand, "$GIT_DIR", workDir)
Debugf("executing filter_command: " + branchFilterCommand)
er := executeCommand(branchFilterCommand, 30, true)
fmt.Printf("%+v", er)
if debug {
fmt.Printf("filter_command %s result: %+v", branchFilterCommand, er)
}
return er.returnCode != 0
}

Expand Down

0 comments on commit 01fbdf0

Please sign in to comment.