Skip to content

Commit

Permalink
Fixes to build scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreidenissov-cog committed Jul 30, 2024
1 parent 917c41a commit 3fd3664
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
6 changes: 4 additions & 2 deletions generate_git_info.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash

# Get the current git commit ID
git_commit=$(git rev-parse HEAD)
# git_commit=$(git rev-parse HEAD)
git_commit=$1

# Get the current git branch name
git_branch=$(git rev-parse --abbrev-ref HEAD)
# git_branch=$(git rev-parse --abbrev-ref HEAD)
git_branch=$2

# Define the output file
output_file="cmd/runner/git_info.go"
Expand Down
16 changes: 16 additions & 0 deletions go-runner-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# Optional:
# APP_HOME - Where the go-runner source is git cloned into.
# If not set we assume you are at the top-level unileaf directory
# GIT_BRANCH - Current git branch for code being built
# GIT_COMMIT - Current git commit id for code being built

set -o errexit
set -o errtrace
Expand All @@ -26,9 +28,23 @@ then
cd "${APP_HOME}"
fi

if [ -z "${GIT_BRANCH}" ]
then
export GIT_BRANCH="unknown branch"
fi
if [ -z "${GIT_COMMIT}" ]
then
export GIT_COMMIT="unknown commit"
fi

source generate_git_info.sh "${GIT_BRANCH}" "${GIT_COMMIT}"

export COMPONENT_NAME=runner-linux-amd64-cpu

go clean -i
go clean -modcache
go clean -cache
go clean -testcache
go mod tidy
go build -ldflags="-extldflags=-static" -buildvcs=false -tags="NO_CUDA" -o cmd/runner/bin/"${COMPONENT_NAME}" ./cmd/runner

Expand Down

0 comments on commit 3fd3664

Please sign in to comment.