-
-
Save foxleigh81/fd8fd3792ae9439c71f96583f0d170ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DISABLE_AUTO_TITLE="true" | |
# Commonly used commands for VMD | |
vmd() { | |
# don't forget to set this variable to your vmd folder | |
vmdDir=~/Dev/vmd | |
# The variable below assumes you're on a .1. subnet, you'll need to change this | |
# if you are not, otherwise, leave it alone. | |
ip=$(ifconfig -a | awk '$1 == "inet" {print $2}' | grep 192.168.1.) | |
# No arguments passed, just go to vmd folder | |
if [[ $# -eq 0 ]] ; then | |
# Gives the session the name 'Applications' | |
echo -e "\033];VMD\007" | |
cd $vmdDir | |
fi | |
# Allows the use of -a or -f to navigate to correct folder | |
if [[ $1 == "-a" ]]; then | |
# Gives the session the name 'Applications' | |
echo -e "\033];Applications\007" | |
cd "${vmdDir}/applications" | |
elif [[ $1 == "-f" ]]; then | |
# Gives the session the name 'Foundations' | |
echo -e "\033];Foundations\007" | |
cd "${vmdDir}/foundations" | |
elif [[ $1 == "--preflight" ]]; then | |
# Gives the session the name 'Preflight checks' | |
echo -e "\033];Foundations\007" | |
echo "\e[34mRunning preflight checks, foundations and applications must be running for this to work\e[0m" | |
echo "\e[36mTest 1 of 3: Marketing Authorisations\e[0m" | |
cd "${vmdDir}/applications/tests/end-to-end/marketing-authorisations" | |
command npm ci | |
command npm run test-local | |
echo "\e[32mTest 1 complete\e[0m" | |
echo "\e[36mTest 2 of 3: Manage My Business\e[0m" | |
cd "${vmdDir}/applications/tests/end-to-end/manage-my-business" | |
command npm ci | |
command npm run test-local | |
echo "\e[32mTest 2 complete\e[0m" | |
echo "\e[36mTest 3 of 3: Admin app\e[0m" | |
cd "${vmdDir}/applications/tests/end-to-end/admin-app-web" | |
command npm ci | |
command npm run test-local | |
echo "\e[32mTest 3 complete\e[0m" | |
echo "\e[32mAll preflight checks complete - please see console for results\e[0m" | |
fi | |
# Launches or stops the docker scripts, if it is the first | |
# argument then it will need to be in the correct folder | |
# if used with the above it can be called anywhere | |
# e.g. `vmd -a --start` | |
if [[ $1 == "--start" || $2 == "--start" ]]; then | |
command ./docker-compose-run.sh -h $ip | |
elif [[ $1 == "--restart" || $2 == "--restart" ]]; then | |
command ./docker-compose-stop.sh | |
command ./docker-compose-run.sh -h $ip | |
elif [[ $1 == "--stop" || $2 == "--stop" ]]; then | |
command ./docker-compose-stop.sh | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment