Compare commits

...

6 Commits

7 changed files with 21 additions and 11 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

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

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 ***"

View File

@@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y git php-cli sudo curl
# Cache Node Dependencies # Cache Node Dependencies
RUN mkdir -p /var/www/api RUN mkdir -p /var/www/api
WORKDIR /var/www/api WORKDIR /var/www/api
RUN echo '{ "dependencies": { "express": "" } }' > package.json RUN echo '{ "dependencies": { "express": ">=4.18.1 < 5.0.0" } }' > package.json
RUN npm install RUN npm install
# Install + Run Website # Install + Run Website

View File

@@ -24,8 +24,10 @@ echo -e "\n`date` - Take down services for a cold backup."
manage.sh -d manage.sh -d
echo -e "\n`date` - Create the backup for '$DOCKER_HOME'." echo -e "\n`date` - Create the backup for '$DOCKER_HOME'."
cd $DOCKER_HOME $time zip -r $file.tmp \
$time zip -r $file.tmp . 1>/dev/null $DOCKER_HOME \
/etc/crontab /etc/cron.d /var/spool/cron \
/var/{log,mail} 1>/dev/null
mv -v $file.tmp $file mv -v $file.tmp $file
echo -e "\n`date` - Done with zipping, check size." echo -e "\n`date` - Done with zipping, check size."

View File

@@ -130,7 +130,7 @@ fi
if [[ -z $up && -z $down && -z $build && -z $pull && -z $clean if [[ -z $up && -z $down && -z $build && -z $pull && -z $clean
&& -z $interact && -z $logs && -z $stats && -z $interact && -z $logs && -z $stats
]]; then ]]; then
docker ps docker ps --size
exit 0 exit 0
fi fi