Skip to content

Commit

Permalink
Update symlinks on server to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
th-otto committed Apr 29, 2024
1 parent 519e232 commit 79ce52e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,24 @@ upload_file() {
exit 1
}

link_file() {
local from="$1"
local to="$2"
for i in 1 2 3
do
ssh -o "StrictHostKeyChecking no" $SERVER -- "cd www/snapshots/${PROJECT_DIR}; ln -sf $from $to"
[ $? = 0 ] && return 0
sleep 1
done
exit 1
}

for f in "" -000 -020 -v4e; do
upload_file "${DEPLOY_DIR}/${ARCHIVE_NAME}${f}.${DEPLOY_ARCHIVE}" "${UPLOAD_DIR}/${PROJECT_DIR}/${ARCHIVE_NAME}${f}.${DEPLOY_ARCHIVE}"
done
if test -z "${CPU_TARGET}"
then
upload_file "$ARCHIVE_PATH" "${UPLOAD_DIR}/${PROJECT_DIR}/${PROJECT_DIR}-latest.${DEPLOY_ARCHIVE}"
link_file "${ARCHIVE_NAME}.${DEPLOY_ARCHIVE}" "${PROJECT_DIR}-latest.${DEPLOY_ARCHIVE}"
fi

echo ${PROJECT_NAME}-${PROJECT_VERSION}-${SHORT_ID} > .latest_version
Expand Down

0 comments on commit 79ce52e

Please sign in to comment.