docker-run-action/entrypoint.sh

10 lines
405 B
Bash
Raw 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
2020-06-17 21:04:51 -04:00
echo "$INPUT_RUN" | sed -e 's/\\n/;/g' > semicolon_delimited_script
2020-06-17 21:00:26 -04:00
exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" --network=$INPUT_DOCKER_NETWORK $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "`cat semicolon_delimited_script`"