Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laradock
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kerwin
laradock
Commits
6bed8d14
Commit
6bed8d14
authored
Jul 15, 2017
by
Arian Acosta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved messages
parent
e26ff8bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
sync.sh
sync.sh
+19
-11
No files found.
sync.sh
View file @
6bed8d14
...
...
@@ -10,32 +10,37 @@ print_style () {
elif
[
"
$2
"
==
"warning"
]
;
then
COLOR
=
"93m"
;
elif
[
"
$2
"
==
"danger"
]
;
then
COLOR
=
"
4
1m"
;
else
#
white
COLOR
=
"
97
m"
;
COLOR
=
"
9
1m"
;
else
#
default color
COLOR
=
"
0
m"
;
fi
STARTCOLOR
=
"
\e
[
1;
$COLOR
"
;
ENDCOLOR
=
"
\e
[m"
;
STARTCOLOR
=
"
\e
[
$COLOR
"
;
ENDCOLOR
=
"
\e
[
0
m"
;
printf
"
$STARTCOLOR
%b
$ENDCOLOR
"
"
$1
"
;
}
if
[[
$#
-eq
0
]]
;
then
print
_style
"Invalid argument."
"danger"
;
printf
" Available command
s:
\n
"
;
display_options
()
{
print
f
"Available option
s:
\n
"
;
print_style
" install"
"success"
;
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
" 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
" trigger"
"success"
;
printf
"
\t\t
Manually triggers the synchronization of files.
\n
"
;
print_style
" clean"
"warning"
;
printf
"
\t\t
Removes all synched files from docker-sync container.
\n
"
;
print_style
" clean"
"warning"
;
printf
"
\t\t
Removes all files from the docker-sync container.
\n
"
;
}
if
[[
$#
-eq
0
]]
;
then
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
time
\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
${
@
}
;
...
...
@@ -43,6 +48,7 @@ if [ "$1" == "up" ] ; then
elif
[
"
$1
"
==
"down"
]
;
then
print_style
"Stopping Docker Compose
\n
"
"info"
;
docker-compose down
;
print_style
"Stopping Docker Sync
\n
"
"info"
;
docker-sync stop
;
...
...
@@ -59,5 +65,7 @@ elif [ "$1" == "clean" ]; then
docker-sync clean
;
else
print_style
"Invalid argument. Use 'up','down','install','trigger' or 'clean'"
"danger"
;
print_style
"Invalid arguments.
\n
"
"danger"
;
display_options
;
exit
1
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment