Skip to content

Commit 5fd233f

Browse files
authored
Merge pull request #10 from aosus/post-upload-command
Add option to execute command post upload
2 parents 1ed1c91 + 0880824 commit 5fd233f

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ Uploads docker compose directory, useful when extra files like Configs are neede
6565
### `docker_compose_directory`
6666
Specifies which directory in the repository to upload, needed for upload_directory
6767

68+
### `post_upload_command`
69+
Optional input to execute a command post upload, when `upload_directory` is enabled. Useful for changing permissions before starting containers.
70+
6871
### `docker_login_user`
6972

7073
The username for the container repository user. (DockerHub, ECR, etc.)

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ inputs:
2424
upload_directory:
2525
description: when enabled, uploads entire docker directory, useful for configuration files needed along the container
2626
required: false
27+
post_upload_command:
28+
description: sets command to run post upload, useful to fix permission issues in configuration files
29+
required: false
2730
docker_compose_directory:
2831
description: specifies which directory to upload, needed for upload_directory
2932
required: false

docker-entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ then
8585
fi
8686
tar cjvf - -C "$GITHUB_WORKSPACE" "$INPUT_DOCKER_COMPOSE_DIRECTORY" | ssh -o StrictHostKeyChecking=no "$INPUT_REMOTE_DOCKER_HOST" 'tar -xjvf -'
8787
echo "Upload finished"
88+
if [ -n "$INPUT_POST_UPLOAD_COMMAND" ];
89+
then
90+
echo "Upload post command specified, runnig. $INPUT_POST_UPLOAD_COMMAND "
91+
ssh -o StrictHostKeyChecking=no "$INPUT_REMOTE_DOCKER_HOST" "eval $INPUT_POST_UPLOAD_COMMAND"
92+
fi
8893
fi
8994

9095
if [ -n "$INPUT_DOCKER_LOGIN_PASSWORD" ] || [ -n "$INPUT_DOCKER_LOGIN_USER" ] || [ -n "$INPUT_DOCKER_LOGIN_REGISTRY" ]; then

0 commit comments

Comments
 (0)