From a1f8ef9614e4ff6ec737264a3c82d69fca315558 Mon Sep 17 00:00:00 2001 From: Arian Acosta Date: Sat, 15 Jul 2017 17:15:07 -0400 Subject: [PATCH] adding default services --- config.txt | 1 + sync-services.txt | 1 + sync.sh | 69 ++++++++++++++++++++++++----------------------- 3 files changed, 38 insertions(+), 33 deletions(-) create mode 100644 config.txt create mode 100644 sync-services.txt diff --git a/config.txt b/config.txt new file mode 100644 index 00000000..072cf128 --- /dev/null +++ b/config.txt @@ -0,0 +1 @@ +THIS ARE THE DEFAILTS diff --git a/sync-services.txt b/sync-services.txt new file mode 100644 index 00000000..dbe16ddf --- /dev/null +++ b/sync-services.txt @@ -0,0 +1 @@ +nginx mysql \ No newline at end of file diff --git a/sync.sh b/sync.sh index a1f8bbbf..9ce4a600 100755 --- a/sync.sh +++ b/sync.sh @@ -18,71 +18,74 @@ print_style () { if [ "$2" == "info" ] ; then - COLOR="96m"; + COLOR="96m" elif [ "$2" == "success" ] ; then - COLOR="92m"; + COLOR="92m" elif [ "$2" == "warning" ] ; then - COLOR="93m"; + COLOR="93m" elif [ "$2" == "danger" ] ; then - COLOR="91m"; + COLOR="91m" else #default color - COLOR="0m"; + COLOR="0m" fi - STARTCOLOR="\e[$COLOR"; - ENDCOLOR="\e[0m"; + STARTCOLOR="\e[$COLOR" + ENDCOLOR="\e[0m" - printf "$STARTCOLOR%b$ENDCOLOR" "$1"; + printf "$STARTCOLOR%b$ENDCOLOR" "$1" } display_options () { printf "Available options:\n"; - print_style " install" "info"; printf "\t\t Installs docker-sync gem on the host machine.\n"; - print_style " up [services]" "success"; printf "\t Starts docker-sync and runs docker compose.\n"; - print_style " down" "success"; printf "\t\t\t Stops containers and docker-sync.\n"; - print_style " bash" "success"; printf "\t\t\t Opens bash on the workspace.\n"; - print_style " trigger" "success"; printf "\t\t Manually triggers the synchronization of files.\n"; - print_style " clean" "warning"; printf "\t\t Removes all files from docker-sync.\n"; + print_style " install" "info"; printf "\t\t Installs docker-sync gem on the host machine.\n" + print_style " up [services]" "success"; printf "\t Starts docker-sync and runs docker compose.\n" + print_style " down" "success"; printf "\t\t\t Stops containers and docker-sync.\n" + print_style " bash" "success"; printf "\t\t\t Opens bash on the workspace.\n" + print_style " trigger" "success"; printf "\t\t Manually triggers the synchronization of files.\n" + print_style " clean" "warning"; printf "\t\t Removes all files from docker-sync.\n" } if [[ $# -eq 0 ]] ; then - print_style "Missing arguments.\n" "danger"; - display_options; + print_style "Missing arguments.\n" "danger" + display_options exit 1 fi if [ "$1" == "up" ] ; then - print_style "Initializing Docker Sync\n" "info"; - print_style "May take a long time (15min+) the first run\n" "info"; + value=$(