Created
August 24, 2016 00:41
-
-
Save yurifrl/d9d0f9c811328a1f31ba26b21e86580d to your computer and use it in GitHub Desktop.
basic-docker.sh
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
#!/bin/bash | |
# Use deploy directory as working directory | |
parent_path=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P ) | |
cd "$parent_path" | |
# halt on any error | |
# set -e | |
build() { | |
docker build -t pomodoro-slack .. | |
} | |
run() { | |
docker run --rm -ti \ | |
-e ENV=development \ | |
-v $(pwd):/app \ | |
-w /app \ | |
-p 80:80 \ | |
pomodoro-slack "$@" | |
} | |
bash() { | |
run bash | |
} | |
continue() { | |
read -p "Press [Enter] key to continue..." key | |
} | |
while : | |
do | |
clear | |
echo "---------------------------------" | |
echo " M A I N - M E N U" | |
echo "---------------------------------" | |
echo '1. build' | |
echo '2. bash' | |
echo '0. exit' | |
echo "---------------------------------" | |
read -r -p "Enter your choice: " option | |
case ${option} in | |
1) build | |
continue;; | |
2) bash | |
continue;; | |
0) break;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment