finalizing changes
This commit is contained in:
parent
7029118f05
commit
8af22b5b37
@ -1 +0,0 @@
|
||||
nginx mysql
|
19
sync.sh
19
sync.sh
@ -3,15 +3,19 @@
|
||||
# This shell script is an optional tool to simplify
|
||||
# the installation and usage of laradock with docker-sync.
|
||||
|
||||
# Make sure that the DOCKER_SYNC_STRATEGY is set in the .env
|
||||
# DOCKER_SYNC_STRATEGY=native_osx # osx
|
||||
# DOCKER_SYNC_STRATEGY=unison # windows
|
||||
|
||||
# To run, make sure to add permissions to this file:
|
||||
# chmod 755 sync.sh
|
||||
|
||||
# Usage:
|
||||
# USAGE EXAMPLE:
|
||||
# Install docker-sync: ./sync.sh install
|
||||
# Start sync and services with nginx and mysql: ./sync.sh up nginx mysql
|
||||
# Stop containers and sync: ./sync.sh down
|
||||
# Open bash inside the workspace: ./sync.sh bash
|
||||
# Force sync: ./sync.sh sync trigger
|
||||
# Force sync: ./sync.sh sync
|
||||
# Clean synced files: ./sync.sh clean
|
||||
|
||||
# prints colored text
|
||||
@ -41,8 +45,8 @@ display_options () {
|
||||
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 " sync" "success"; printf "\t\t Manually triggers the synchronization of files.\n"
|
||||
print_style " clean" "danger"; printf "\t\t Removes all files from docker-sync.\n"
|
||||
}
|
||||
|
||||
if [[ $# -eq 0 ]] ; then
|
||||
@ -52,16 +56,13 @@ if [[ $# -eq 0 ]] ; then
|
||||
fi
|
||||
|
||||
if [ "$1" == "up" ] ; then
|
||||
value=$(<sync-services.txt)
|
||||
echo "$value"
|
||||
|
||||
print_style "Initializing Docker Sync\n" "info"
|
||||
print_style "May take a long time (15min+) the first run\n" "info"
|
||||
docker-sync start;
|
||||
|
||||
print_style "Initializing Docker Compose\n" "info"
|
||||
shift # removing first argument
|
||||
docker-compose -f docker-compose.yml -f docker-compose.sync.yml up -d $value
|
||||
docker-compose -f docker-compose.yml -f docker-compose.sync.yml up -d ${@}
|
||||
|
||||
elif [ "$1" == "down" ]; then
|
||||
print_style "Stopping Docker Compose\n" "info"
|
||||
@ -77,7 +78,7 @@ elif [ "$1" == "install" ]; then
|
||||
print_style "Installing docker-sync\n" "info"
|
||||
gem install docker-sync
|
||||
|
||||
elif [ "$1" == "trigger" ]; then
|
||||
elif [ "$1" == "sync" ]; then
|
||||
print_style "Manually triggering sync between host and docker-sync container.\n" "info"
|
||||
docker-sync sync;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user