Allow specifying the branch of the Hugo project.

This commit is contained in:
2025-08-19 15:03:12 -07:00
parent 4aa7fa4b00
commit 2663bb5351
3 changed files with 14 additions and 7 deletions

View File

@@ -32,4 +32,4 @@ RUN chmod +x /root/main.sh
# Install + Run Website # Install + Run Website
WORKDIR /var/www/ WORKDIR /var/www/
USER root USER root
CMD /root/main.sh "$REPO" "$PROD" "$DEV" CMD /root/main.sh "$REPO" "$BRANCH" "$PROD" "$DEV"

View File

@@ -9,6 +9,7 @@ COMPOSE_BAKE=true
## Git Website Repository ## Git Website Repository
# #
REPO=https://git.hyperling.com/me/hugo-jackanope REPO=https://git.hyperling.com/me/hugo-jackanope
BRANCH=main
# #
## Web Environments ## Web Environments

View File

@@ -1,18 +1,24 @@
#!/usr/bin/env bash #!/usr/bin/env bash
REPO="$1" REPO="$1"
echo "REPO=$REPO" echo "REPO='$REPO'"
PROD="$2" BRANCH="$2"
if [[ -n $BRANCH ]]; then
BRANCH="--branch $BRANCH"
fi
echo "BRANCH='$BRANCH'"
PROD="$3"
typeset -u PROD typeset -u PROD
echo "PROD=$PROD" echo "PROD='$PROD'"
DEV="$3" DEV="$4"
typeset -u DEV typeset -u DEV
echo "DEV=$DEV" echo "DEV='$DEV'"
echo "*** Creating Git Repo ***" echo "*** Creating Git Repo ***"
sudo -u www-data git clone --recurse-submodules $REPO /var/www/hugo/site sudo -u www-data git clone --recurse-submodules $BRANCH $REPO /var/www/hugo/site
status="$?" status="$?"
echo "*** Validating Git Repo ***" echo "*** Validating Git Repo ***"