From 489d8554084296c048877d12bb02f816e801283b Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Wed, 25 Jul 2018 15:17:39 -0500 Subject: [PATCH] explain compound commands --- README.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8162e20..51afe70 100644 --- a/README.md +++ b/README.md @@ -63,19 +63,64 @@ The same is true for the rest of the `embark` commands. To see the full list: ``` shell run_embark --help ``` -``` shell -run_embark embark run -``` -Other `embark` commands and non-embark commands should be indicated explicitly: +### Compound commands + +A single command with options can be supplied directly: ``` shell -run_embark embark version +run_embark bash ``` ``` shell run_embark ps -ef ``` +Compound commands should be passed to `bash -[i]c`: + +``` shell +run_embark bash -c 'exec bash << "SCRIPT" + +simple_nodeenv 10.7.0 my_node +node --version +echo $(which node) +npm i -g http-server +exec http-server -p 10000 + +SCRIPT +' +``` + +When executing compound commands via `docer exec` in a running embark +container, `su-exec` and `bash -ic` can be used together: + +``` shell +docker exec -it su-exec embark \ + bash -ic 'exec bash << "SCRIPT" + +simple_nodeenv 10.7.0 my_other_node +npm i -g http-server +exec http-server -p 10001 + +SCRIPT +' +``` + +Alternatively, to go non-interactive, manually source the embark user's +`.bash_env`: + +``` shell +docker exec -it su-exec embark \ + bash -c 'exec bash << "SCRIPT" + +. ~/.bash_env +simple_nodeenv 10.7.0 more_nodez +npm i -g http-server +exec http-server -p 10002 + +SCRIPT +' +``` + ## Updating versions * Open `Dockerfile`