Skip to content

Commit

Permalink
fix #24: Gitcommit not getting added in version
Browse files Browse the repository at this point in the history
  • Loading branch information
navilg committed Apr 30, 2023
1 parent 87951b3 commit 01492f0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
go version || exit 1

commitId=$(git log --format="%H" -n 1)
echo $commitId

sed -i "s|###GitCommitPlaceholder###|${commitId}|g" internal/config/config.go
sed -i "s|var gitCommit string = \"###GitCommitPlaceholder###\"|var gitCommit string = \"${commitId}\"|g" internal/config/config.go

# Linux
echo "Building for Linux OS with AMD64 Arch"
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o k8senv-linux-amd64 main.go && echo "✅ DONE" || echo "❌ FAILED"
echo "Building for Linux OS with ARM64 Arch"
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o k8senv-linux-arm64 main.go && echo "✅ DONE" || echo "❌ FAILED"

sed -i "s|${commitId}|###GitCommitPlaceholder###|g" internal/config/config.go
sed -i "s|var gitCommit string = \"${commitId}\"|var gitCommit string = \"###GitCommitPlaceholder###\"|g" internal/config/config.go

# macOS
# echo "Building for MacOS with AMD64 Arch"
Expand Down

0 comments on commit 01492f0

Please sign in to comment.