Skip to content

Instantly share code, notes, and snippets.

@gbirke
Last active May 13, 2019 13:36
Show Gist options
  • Save gbirke/62c21601140af1f9c3ceb40c0fe438f1 to your computer and use it in GitHub Desktop.
Save gbirke/62c21601140af1f9c3ceb40c0fe438f1 to your computer and use it in GitHub Desktop.
WMDE Fundraising deployment shell menu
#!/bin/bash
HEIGHT=15
WIDTH=40
CHOICE_HEIGHT=4
TITLE="Deploy fundraising apps"
MENU="Choose one of the following options:"
OPTIONS=(T "Fundraising Frontend TEST "
L "Fundraising Frontend LAIKA SKIN"
P "Fundraising Frontend PRODUCTION"
X "Backend TEST"
B "Backend PRODUCTION")
CHOICE=$(dialog --clear \
--title "$TITLE" \
--menu "$MENU" \
$HEIGHT $WIDTH $CHOICE_HEIGHT \
"${OPTIONS[@]}" \
2>&1 >/dev/tty)
clear
case $CHOICE in
T)
set -o xtrace
ssh -t [email protected] 'ansible-playbook -vi FundraisingFrontend/deployment/inventory/test FundraisingFrontend/deployment/deployment.yml'
set +o xtrace
;;
L)
set -o xtrace
ssh -t [email protected] 'ansible-playbook -vi FundraisingFrontend/deployment/inventory/laika FundraisingFrontend/deployment/deployment.yml'
set +o xtrace
;;
P)
set -o xtrace
ssh -t [email protected] 'ansible-playbook -vi FundraisingFrontend/deployment/inventory/production FundraisingFrontend/deployment/deployment.yml'
set +o xtrace
;;
X)
set -o xtrace
ssh -t [email protected] 'ansible-playbook -vv -i fundraising-backend/deployment/inventory/test fundraising-backend/deployment/deployment.yml'
set +o xtrace
;;
B)
set -o xtrace
ssh -t [email protected] 'ansible-playbook -vv -i fundraising-backend/deployment/inventory/production fundraising-backend/deployment/deployment.yml'
set +o xtrace
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment