Update entrypoint.sh
This commit is contained in:
parent
c4ecacfccb
commit
bc4fb13afa
1 changed files with 10 additions and 1 deletions
|
@ -4,4 +4,13 @@ echo -e "${INPUT_KEY}" >__TEMP_INPUT_KEY_FILE
|
|||
|
||||
chmod 600 __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=$(cat .git-commit)
|
||||
if [[ -z "$COMMIT_SHA" ]]; then
|
||||
echo "No .git-commit file found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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
|
||||
echo File transfer complete, symlinking & purging old
|
||||
ssh -P "${INPUT_PORT}" "${INPUT_USER}"@"${INPUT_HOST}" -C "ln -s ${INPUT_REMOTE}/${COMMIT_SHA} ${INPUT_REMOTE}/latest && find . -mindepth 1 -maxdepth 1 -type d -not -path "./latest" | tail -n +5 | rm -r"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue