shortcuts

This commit is contained in:
Michael Bradley, Jr 2018-07-24 22:27:03 -05:00
parent 987799ff47
commit 93bea147ce
2 changed files with 43 additions and 7 deletions

View File

@ -5,9 +5,9 @@
In a Bash shell:
``` shell
source <(curl 'https://raw.githubusercontent.com/embark-framework/embark-docker/master/run.sh')
run_embark_docker embark demo
run_embark demo
cd embark_demo
run_embark_docker
run_embark
```
With overrides:
@ -28,13 +28,42 @@ docker build \
$EMBARK_DOCKERFILE
source <(curl $RUNNER)
run_embark_docker embark demo
run_embark demo
cd embark_demo
run_embark_docker
run_embark
```
Review the [Dockerfile](https://github.com/embark-framework/embark-docker/blob/master/Dockerfile) and [run.sh](https://github.com/embark-framework/embark-docker/blob/master/run.sh#L66-L70) for all possible overrides.
### Shortcuts
The following are equivalent:
``` shell
run_embark demo
```
``` shell
run_embark embark demo
```
These are also equivlent:
``` shell
run_embark
```
``` shell
run_embark embark run
```
Other `embark` commands and non-embark commands should be indicated explicitly:
``` shell
run_embark embark version
```
``` shell
run_embark ps -ef
```
## Updating versions
* Open `Dockerfile`

13
run.sh
View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
run_embark_docker () {
run_embark () {
local oldopts=""
case $- in
*e*) oldopts="set -e";;
@ -69,6 +69,13 @@ run_embark_docker () {
local EMBARK_DOCKER_IMAGE=${EMBARK_DOCKER_IMAGE:-statusim/embark}
local EMBARK_DOCKER_TAG=${EMBARK_DOCKER_TAG:-latest}
local -a cmd=
if [[ "$1" = "demo" ]]; then
cmd=( $(echo "embark $@") )
else
cmd=( $(echo "$@") )
fi
docker run \
-it \
-p 5001:5001 \
@ -85,7 +92,7 @@ run_embark_docker () {
-e TERM \
"${EMBARK_DOCKER_EXTRA_RUN_OPTS}" \
${EMBARK_DOCKER_IMAGE}:${EMBARK_DOCKER_TAG} \
"$@"
"${cmd[@]}"
local docker_exit_status=$?
@ -103,5 +110,5 @@ run_embark_docker () {
}
if [[ "$0" = "$BASH_SOURCE" ]]; then
run_embark_docker "$@"
run_embark "$@"
fi