From 2fe251c0367860fe3e7ad046ca923e0963934421 Mon Sep 17 00:00:00 2001 From: Jochen Welzel Date: Mon, 18 Jan 2021 17:17:46 +0100 Subject: [PATCH] add real upload script --- scp_and_reload.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scp_and_reload.sh b/scp_and_reload.sh index 2c0fca8..214ee97 100644 --- a/scp_and_reload.sh +++ b/scp_and_reload.sh @@ -1,7 +1,15 @@ #!/bin/bash -pwd -echo "" -ls -la -echo "" -env +CHFILENAMES=$(git diff-tree --no-commit-id --name-only $DRONE_COMMIT) + +mkdir .ssh +echo $PLUGIN_KEY > .ssh/id_rsa +chmod 600 .ssh/id_rsa + +for file in $CHFILENAMES; do + if [[ $file == *"zone" ]]; then + scp $file "$PLUGIN_USER"@"$PLUGIN_HOSTS":"$PLUGIN_TARGET"/$file + ZONE = $(echo $file | sed 's/\.zone//') + ssh "PLUGIN_USER"@"$PLUGIN_HOSTS" nsd-control reload $ZONE + fi +done