--- /dev/null
+#!/bin/bash
+
+BRANCH=${1:-master} # Use the first argument as the branch, default to 'master' if not provided
+DO_FETCH=${2:-nofetch}
+CURRENT_DIR=$(pwd)
+
+# Function to check branch and prompt
+check_branch_and_prompt() {
+ local dir=$1
+
+ local display_dir=$dir
+ if [ "$dir" == "." ]; then
+ display_dir="phs-stack"
+ fi
+
+ cd $dir
+ current_branch=$(git rev-parse --abbrev-ref HEAD)
+ if [ "$current_branch" != "$BRANCH" ]; then
+ echo -e "\033[1m[$display_dir]\033[22m Warning: You are on branch '$current_branch' instead of '$BRANCH' in '$display_dir'."
+ echo -ne "\033[1m[$display_dir]\033[22m Press 'Enter' to checkout and pull '$BRANCH', 's' to skip, or 'q' / Ctrl-C to quit the script: "
+ while true; do
+ read -n 1 -s user_input
+ if [ "$user_input" == "s" ]; then
+ echo -e "\033[1m[$display_dir]\033[22m Skipping $dir..."
+ echo
+ cd $CURRENT_DIR
+ return
+ elif [ "$user_input" == "q" ]; then
+ echo
+ echo -e "\033[1m[$display_dir]\033[22m Cancelling..."
+ exit 1
+ elif [ "$user_input" == "" ]; then
+ break
+ else
+ echo -ne "\033[1m[$display_dir]\033[22m Invalid input. Press 'Enter' to checkout and pull '$BRANCH', 's' to skip, or 'q' / Ctrl-C to quit the script: "
+ fi
+ done
+ fi
+
+ echo
+ if [ "$DO_FETCH" == "fetch" ]; then
+ echo git fetch
+ git fetch
+ fi
+ echo git checkout $BRANCH --
+ git checkout $BRANCH --
+ echo git pull origin $BRANCH
+ git pull origin $BRANCH;
+ cd $CURRENT_DIR
+ echo
+}
+
+echo -e "Checking out branch \033[1m'$BRANCH'\033[22m on all volumes, including the phs-stack directory..."
+echo
+check_branch_and_prompt .
+check_branch_and_prompt volumes/phs-api
+#check_branch_and_prompt volumes/phs-app
+check_branch_and_prompt volumes/phs-employee
+#check_branch_and_prompt volumes/phs-customer
+check_branch_and_prompt volumes/phs-admin
+echo All done.
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+phs_env="DEV"
+imagever_db="1.3"
+imagever_api="1.8"
+imagever_ionic="1.6"
+imagever_jobs="1.3"
+
+# Make sure we are logged into Docker Hub
+docker login
+
+host=$(hostname)
+if [ "$host" == "wrayhome" ]; then
+ echo "Starting Production Stack"
+ phs_env="PRODUCTION"
+else
+ echo "Starting Dev Stack"
+fi
+
+echo "Enter module to restart, e.g. jobs, or api, or all to restart the entire stack"
+read module
+
+echo "Enter S to stop the module(s) and not restart it, else just hit enter"
+read stop_only
+
+if [ "$module" == "all" ]; then
+ echo "Make sure stack is shut down. Safely ignore errors if stack is not even up"
+ PHS_ENV=$phs_env IMAGEVER_JOBS=$imagever_jobs IMAGEVER_API=$imagever_api IMAGEVER_DB=$imagever_db IMAGEVER_IONIC=$imagever_ionic docker-compose down --remove-orphans
+
+ if [ "$stop_only" == "" ]; then
+ echo "Bringing up the stack."
+ PHS_ENV=$phs_env IMAGEVER_JOBS=$imagever_jobs IMAGEVER_API=$imagever_api IMAGEVER_DB=$imagever_db IMAGEVER_IONIC=$imagever_ionic docker-compose up -d --build;
+ fi
+else
+ echo "Shutting down $module..."
+ PHS_ENV=$phs_env IMAGEVER_JOBS=$imagever_jobs IMAGEVER_API=$imagever_api IMAGEVER_DB=$imagever_db IMAGEVER_IONIC=$imagever_ionic docker-compose rm -s -v -f $module
+
+ if [ "$stop_only" == "" ]; then
+ echo "Bringing up $module..."
+ PHS_ENV=$phs_env IMAGEVER_JOBS=$imagever_jobs IMAGEVER_API=$imagever_api IMAGEVER_DB=$imagever_db IMAGEVER_IONIC=$imagever_ionic docker-compose up -d --build $module;
+ fi
+fi