Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support for build path #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Fail fast
set -e

# Default build path is current directory if not specified
DOCKER_BUILD_PATH=${DOCKER_BUILD_PATH:-.}

branch_name=$(git branch --show-current)

if [[ "$branch_name" == *release* ]]; then
Expand All @@ -29,9 +32,9 @@ echo "new_tag=$NEW_TAG" >> $GITHUB_OUTPUT

docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASSWORD
if [ -n "$SENTRY_AUTH_TOKEN" ]; then
docker build -t $DOCKERHUB_USERNAME/$IMAGE_NAME:$NEW_TAG --build-arg ssh_prv_key="$SSH_PRIVATE_KEY" --build-arg SENTRY_AUTH_TOKEN="$SENTRY_AUTH_TOKEN" .
docker build -t $DOCKERHUB_USERNAME/$IMAGE_NAME:$NEW_TAG --build-arg ssh_prv_key="$SSH_PRIVATE_KEY" --build-arg SENTRY_AUTH_TOKEN="$SENTRY_AUTH_TOKEN" -f $DOCKER_BUILD_PATH/Dockerfile $DOCKER_BUILD_PATH
else
docker build -t $DOCKERHUB_USERNAME/$IMAGE_NAME:$NEW_TAG --build-arg ssh_prv_key="$SSH_PRIVATE_KEY" .
docker build -t $DOCKERHUB_USERNAME/$IMAGE_NAME:$NEW_TAG --build-arg ssh_prv_key="$SSH_PRIVATE_KEY" -f $DOCKER_BUILD_PATH/Dockerfile $DOCKER_BUILD_PATH
fi
echo "Pushing Docker Image to Docker Hub";
docker push $DOCKERHUB_USERNAME/$IMAGE_NAME:$NEW_TAG
Expand Down