Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
a18c3ff0
Commit
a18c3ff0
authored
Jun 02, 2019
by
neilpang
Browse files
use `sh -c`
parent
64928b28
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy/docker.sh
View file @
a18c3ff0
...
...
@@ -156,21 +156,25 @@ _docker_exec() {
_dcid
=
"
$1
"
shift
if
[
"
$_USE_DOCKER_COMMAND
"
]
;
then
docker
exec
-i
"
$_dcid
"
"
$
@
"
docker
exec
-i
"
$_dcid
"
sh
-c
"
$
*
"
elif
[
"
$_USE_REST
"
]
;
then
_err
"Not implemented yet."
return
1
elif
[
"
$_USE_UNIX_SOCKET
"
]
;
then
_cmd
=
"
$*
"
_cmd
=
"
$(
printf
"%s"
"
$_cmd
"
|
sed
's/ /","/g'
)
"
#
_cmd="$(printf "%s" "$_cmd" | sed 's/ /","/g')"
_debug2 _cmd
"
$_cmd
"
#create exec instance:
cjson
=
"
$(
_curl_unix_sock
"
$_DOCKER_SOCK
"
POST
"/containers/
$_dcid
/exec"
"{
\"
Cmd
\"
: [
\"
$_cmd
\"
]}"
)
"
cjson
=
"
$(
_curl_unix_sock
"
$_DOCKER_SOCK
"
POST
"/containers/
$_dcid
/exec"
"{
\"
Cmd
\"
: [
\"
sh
\"
,
\"
-c
\"
,
\"
$_cmd
\"
]}"
)
"
_debug2 cjson
"
$cjson
"
execid
=
"
$(
echo
"
$cjson
"
|
cut
-d
'"'
-f
4
)
"
_debug execid
"
$execid
"
ejson
=
"
$(
_curl_unix_sock
"
$_DOCKER_SOCK
"
POST
"/exec/
$execid
/start"
"{
\"
Detach
\"
: false,
\"
Tty
\"
: false}"
)
"
_debug2 ejson
"
$ejson
"
if
[
"
$ejson
"
]
;
then
_err
"
$ejson
"
return
1
fi
else
_err
"Not implemented yet."
return
1
...
...
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