diff --git a/Makefile b/Makefile index 26d1bc9..5f8bfc7 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,15 @@ DOCKER_PLATFORM=linux/amd64 #To prevent the circular dependency, this repo calls the dockerBuild script directly # instead of through the builder-docker image. docker: - ./src/dockerBuild.sh dockerBuild -e ${DOCKER_REGISTRY} -r ${DOCKER_REPO} -p ${DOCKER_PLATFORM} -d "." -f ./docker/Dockerfile ${ARGS} + ./src/dockerBuild.sh \ + dockerBuild \ + -e ${DOCKER_REGISTRY} \ + -r ${DOCKER_REPO} \ + -p ${DOCKER_PLATFORM} \ + -d "." \ + -g "." \ + -f ./docker/Dockerfile \ + ${ARGS} #Everything right of the pipe is order-only prerequisites. all: | docker diff --git a/src/dockerBuild.sh b/src/dockerBuild.sh index bfa76b3..4a210a4 100755 --- a/src/dockerBuild.sh +++ b/src/dockerBuild.sh @@ -109,9 +109,9 @@ function dockerBuild exit 1 fi - #If not git repo provided, default to current directory + #If not git repo provided, default to the code dir if [ -z "$GIT_DIR" ]; then - GIT_DIR="./.git" + GIT_DIR="$CODE_DIR/.git" fi #Default is to just tag with the git version. @@ -127,7 +127,7 @@ function dockerBuild #Find the current git branch. local gitBranch="" - gitBranch=$(git branch --show-current) + gitBranch=$(git --git-dir "$GIT_DIR" branch --show-current) if [ -z "$gitBranch" ]; then echo "Could not determine git branch name, caching to main." gitBranch="$MAIN_BRANCH"