29 lines
501 B
Text
29 lines
501 B
Text
|
#!/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
|