docker-run-action/entrypoint.sh

12 lines
400 B
Bash
Raw Permalink Normal View History

2020-06-17 18:47:31 -04:00
#!/usr/bin/env bash
if [ ! -z $INPUT_USERNAME ];
2020-06-17 22:21:03 -04:00
then echo $INPUT_PASSWORD | docker login $INPUT_REGISTRY -u $INPUT_USERNAME --password-stdin
2020-06-17 18:47:31 -04:00
fi
2021-02-15 16:21:09 -05:00
if [ ! -z $INPUT_DOCKER_NETWORK ];
then INPUT_OPTIONS="$INPUT_OPTIONS --network $INPUT_DOCKER_NETWORK"
fi
2021-04-07 14:41:21 +02:00
exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "${INPUT_RUN//$'\n'/;}"