Skip to content

Instantly share code, notes, and snippets.

@laynemoseley
Last active October 1, 2019 19:16
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laynemoseley/b500c1775c61337f2653170f708c5779 to your computer and use it in GitHub Desktop.
Save laynemoseley/b500c1775c61337f2653170f708c5779 to your computer and use it in GitHub Desktop.
Zork deploy script
#!/bin/bash
echo "You enter a dark dungeon. A sign in front of you says: Choose wisely or you'll probably die."
read -p 'staging or production: ' ENV
if [ $ENV != "staging" ] && [ $ENV != "production" ]
then
echo "You go into the wrong hallway, a skeleton comes out and decapitates you. The End."
exit 1
fi
echo ""
echo "You slowly walk down the halls of $ENV. Are you sure you wish to continue? There is no going back now."
read -p 'yes or no: ' CONFIRM
if [ $CONFIRM != "yes" ]
then
echo "You have decided to back out of the dungeon. On your way out, an ogre smashes your face with a club and you die. The End."
exit 1
fi
sleep 1
echo ""
echo "You move farther down the hallway. You see a signpost that says: Keep going! You probably won't die now. gratz"
sleep 2
echo ""
echo "You enter a small room. Inside of the room is a man. He turns to you and says:"
sleep 2
if [ $ENV == "staging" ]; then
echo "I have recieved your deploy request. It shall be granted."
sleep 2
fi
if [ $ENV == "production" ]; then
echo "Is it Friday?"
read -p 'yes or no: ' IS_FRIDAY
if [ $IS_FRIDAY == "yes" ]; then
echo "The man casts a spell that melts the flesh from your bones. As your mind begins to fade, he walks over to the puddle that is now you and slowly laughs."
sleep 1
echo "He says: You fool. You cannot go to production on a Friday."
sleep 2
exit 1
fi
echo "Deploying to production requires sacrifice. Defeat me in battle."
sleep 1
echo "What do you do next?"
read -p 'sword, magic or courage: ' FINAL_CHOICE
if [ $FINAL_CHOICE == "sword" ]; then
echo "You pull our your sword and battle the man. He is weak and doesn't put up a fight."
echo "Guilt spreads throughout your body as his blood covers the floor."
echo "You turn away and walk out of the dungeon, defeated. You can't deploy to production with violence. The End."
exit 1
elif [ $FINAL_CHOICE == "magic" ]; then
echo "You take your staff and cast fireball. The man explodes, as well as all of the servers."
echo "The flame is so hot and intense, you are sucked in as well and burn to death. The End."
exit 1
elif [ $FINAL_CHOICE == "courage" ]; then
echo "You are wise. Violence only brings hurt to your users. Please take care. Your request is granted."
else
echo "You stand still and do nothing. The man summons a elemental that absorbs your body. You die. The End."
exit 1
fi
fi
sleep 1
DATE=`date +"%m-%d-%y"`
TIME=`date +"%H-%M-%S"`
FULLDATE="$DATE-$TIME"
TAG="$ENV/$FULLDATE"
ANNOTATION="$ENV deploy on $DATE at $TIME"
echo ""
echo "Tag: $TAG"
echo "Annotation: $ANNOTATION"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment