Added up srvnode script
This commit is contained in:
parent
a8373ca11a
commit
84450546ce
3 changed files with 32 additions and 1 deletions
28
ex/srvnode
Executable file
28
ex/srvnode
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
DOCKER_RUN_CMD="docker run --rm -it"
|
||||
|
||||
VOLUMES="-v $(pwd):/app"
|
||||
|
||||
if [[ -f "$HOME/.gitconfig" ]]
|
||||
then
|
||||
VOLUMES="$VOLUMES -v $HOME/.gitconfig:/home/node/.gitconfig"
|
||||
fi
|
||||
|
||||
if [[ -d "$HOME/.ssh" ]]
|
||||
then
|
||||
VOLUMES="$VOLUMES -v $HOME/.ssh:/home/node/.ssh"
|
||||
fi
|
||||
|
||||
DOCKER_RUN_CMD="$DOCKER_RUN_CMD $VOLUMES docker.ci/srv/node:latest"
|
||||
|
||||
shift
|
||||
|
||||
if [[ -z "$@" ]]
|
||||
then
|
||||
echo Executing: $DOCKER_RUN_CMD bash
|
||||
exec $DOCKER_RUN_CMD bash
|
||||
else
|
||||
echo Executing: $DOCKER_RUN_CMD $@
|
||||
exec $DOCKER_RUN_CMD $@
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue