From 93b0f4fb862431a9859d4c15b7a8ef579c4250d7 Mon Sep 17 00:00:00 2001 From: jackz Date: Wed, 11 Dec 2024 20:44:01 -0600 Subject: [PATCH] Update entrypoint.sh --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 84eb920..38e33da 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,7 @@ echo -e "${INPUT_KEY}" >__TEMP_INPUT_KEY_FILE chmod 600 __TEMP_INPUT_KEY_FILE -COMMIT_SHA=$(cat .git-commit) +COMMIT_SHA=$(cat ${INPUT_SRC}/.git-commit) if [[ -z "$COMMIT_SHA" ]]; then echo "No .git-commit file found" exit 1 @@ -12,5 +12,6 @@ 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"