Skip to content

Commit

Permalink
Fixed tag builds
Browse files Browse the repository at this point in the history
  • Loading branch information
flounderpinto committed Dec 11, 2023
1 parent 7c95767 commit 0e8f748
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 705 deletions.
13 changes: 8 additions & 5 deletions src/dockerBuild.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
MAIN_BRANCH="main"

function dockerBuildUsage
{
Expand Down Expand Up @@ -123,15 +124,17 @@ function dockerBuild
TAGS+=("$gitVersion")
fi

#Find the current git branch.
local gitBranch=""
gitBranch=$(git branch --show-current)
if [ -z "$gitBranch" ]; then
echo "Error, Could not determine git branch name."
exit 1
echo "Could not determine git branch name, caching to main."
gitBranch="$MAIN_BRANCH"
else
#Tag with the branch name, so we have a tag that tracks the latest version of a branch,
# and also so that we have a location to push the build cache.
TAGS+=("$gitBranch")
fi
#Tag with the branch name, so we have a tag that tracks the latest version of a branch,
# and also so that we have a location to push the build cache.
TAGS+=("$gitBranch")

echo "REGISTRY:$DOCKER_REGISTRY"
echo "REPO:$DOCKER_REPO"
Expand Down
Loading

0 comments on commit 0e8f748

Please sign in to comment.