podman-run-action/entrypoint.sh

14 lines
480 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
2021-02-15 16:21:09 -05:00
if [ ! -z $INPUT_DOCKER_NETWORK ];
then INPUT_OPTIONS="$INPUT_OPTIONS --network $INPUT_DOCKER_NETWORK"
fi
exec docker run -v "/var/run/docker.sock":"/var/run/docker.sock" $INPUT_OPTIONS --entrypoint=$INPUT_SHELL $INPUT_IMAGE -c "`cat semicolon_delimited_script`"