Initial commit

This commit is contained in:
Marco Dalla Santa
2020-12-18 17:22:26 +01:00
commit ca82210d43
9 changed files with 216 additions and 0 deletions

24
with_key.sh Normal file
View File

@@ -0,0 +1,24 @@
echo "🔑 Adding ssh key..." &&
eval $(ssh-agent -s) &&
ssh-add <(echo "${INPUT_KEY}") &&
echo "🔐 Added ssh key";
PRE_UPLOAD=${INPUT_PRE_UPLOAD}
if [ ! -z "$PRE_UPLOAD" ]; then
echo "👌 Executing pre-upload script..." &&
ssh ${INPUT_SSH_OPTIONS} ${INPUT_USER}@${INPUT_HOST} "$INPUT_PRE_UPLOAD && exit" &&
echo "✅ Executed pre-upload script";
fi
echo "🚚 Uploading via scp..." &&
scp ${INPUT_SSH_OPTIONS} ${INPUT_SCP_OPTIONS} -P "${INPUT_PORT}" -r ${INPUT_LOCAL} ubuntu@${INPUT_HOST}:"${INPUT_REMOTE}" &&
echo "🙌 Uploaded via scp";
POST_UPLOAD=${INPUT_POST_UPLOAD}
if [ ! -z "$POST_UPLOAD" ]; then
echo "👌 Executing post-upload script..." &&
ssh ${INPUT_SSH_OPTIONS} ${INPUT_USER}@${INPUT_HOST} "$POST_UPLOAD && exit" &&
echo "✅ Executed post-upload script";
fi
echo "🎉 Done";