Merge branch 'master' of ssh://git.jackz.me:222/jackz/ssh-scp-deploy
This commit is contained in:
commit
80286d41fa
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh -l
|
#!/bin/sh -l
|
||||||
set -e
|
set -e
|
||||||
echo -e "${INPUT_KEY}" >__TEMP_INPUT_KEY_FILE
|
echo -e "${INPUT_KEY}" >__TEMP_INPUT_KEY_FILE
|
||||||
|
set -x
|
||||||
|
|
||||||
chmod 600 __TEMP_INPUT_KEY_FILE
|
chmod 600 __TEMP_INPUT_KEY_FILE
|
||||||
|
|
||||||
|
@ -9,6 +10,10 @@ if [[ -z "$COMMIT_SHA" ]]; then
|
||||||
echo "COMMIT_SHA: Could not find file ${INPUT_SRC}/.git-commit"
|
echo "COMMIT_SHA: Could not find file ${INPUT_SRC}/.git-commit"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo "SSH Host: ${INPUT_USER}@${INPUT_HOST}:${INPUT_PORT}"
|
||||||
|
echo "Local Path: ${INPUT_SRC}"
|
||||||
|
echo "Remote Path: ${INPUT_REMOTE}"
|
||||||
|
echo "Commit: ${COMMIT_SHA}"
|
||||||
|
|
||||||
scp -o StrictHostKeyChecking=no -v -i __TEMP_INPUT_KEY_FILE \
|
scp -o StrictHostKeyChecking=no -v -i __TEMP_INPUT_KEY_FILE \
|
||||||
-P "${INPUT_PORT}" $INPUT_OPTIONS -r ${INPUT_SRC} "${INPUT_USER}"@"${INPUT_HOST}":"${INPUT_REMOTE}/${COMMIT_SHA}" 2>/dev/null
|
-P "${INPUT_PORT}" $INPUT_OPTIONS -r ${INPUT_SRC} "${INPUT_USER}"@"${INPUT_HOST}":"${INPUT_REMOTE}/${COMMIT_SHA}" 2>/dev/null
|
||||||
|
@ -16,7 +21,6 @@ scp -o StrictHostKeyChecking=no -v -i __TEMP_INPUT_KEY_FILE \
|
||||||
echo "File transfer complete."
|
echo "File transfer complete."
|
||||||
echo "Symlinking, purging old"
|
echo "Symlinking, purging old"
|
||||||
echo "Running on ssh: ln -s ${INPUT_REMOTE}/${COMMIT_SHA} ${INPUT_REMOTE}/latest"
|
echo "Running on ssh: ln -s ${INPUT_REMOTE}/${COMMIT_SHA} ${INPUT_REMOTE}/latest"
|
||||||
|
|
||||||
ssh -o StrictHostKeyChecking=no -v -i __TEMP_INPUT_KEY_FILE \
|
ssh -o StrictHostKeyChecking=no -v -i __TEMP_INPUT_KEY_FILE \
|
||||||
"${INPUT_USER}"@"${INPUT_HOST}" -p "${INPUT_PORT}" \
|
"${INPUT_USER}"@"${INPUT_HOST}" -p "${INPUT_PORT}" \
|
||||||
-C "ln -s ${INPUT_REMOTE}/${COMMIT_SHA} ${INPUT_REMOTE}/latest && find ${INPUT_REMOTE} -mindepth 1 -maxdepth 1 -type d -not -path './latest' | tail -n +5 > rm_result.txt"
|
-C "ln -s ${INPUT_REMOTE}/${COMMIT_SHA} ${INPUT_REMOTE}/latest && find ${INPUT_REMOTE} -mindepth 1 -maxdepth 1 -type d -not -path './latest' | tail -n +5 > rm_result.txt"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue