Merge pull request 'Allow Alternative Hugo Website Branches' (#10) from dev into main

Reviewed-on: #10
This commit is contained in:
2025-08-19 15:11:39 -07:00
4 changed files with 15 additions and 7 deletions

View File

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

View File

@@ -13,6 +13,7 @@ services:
- 1380:1380 # Development files with drafts served by Hugo Server.
environment:
- REPO=$REPO
- BRANCH=$BRANCH
- PROD=$PROD
- DEV=$DEV
healthcheck:

View File

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

View File

@@ -1,18 +1,24 @@
#!/usr/bin/env bash
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
echo "PROD=$PROD"
echo "PROD='$PROD'"
DEV="$3"
DEV="$4"
typeset -u DEV
echo "DEV=$DEV"
echo "DEV='$DEV'"
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="$?"
echo "*** Validating Git Repo ***"