Skip to content

Commit

Permalink
Change order of filename and cleanup /tmp
Browse files Browse the repository at this point in the history
after deploy.

The new filename allows for easy sorting of files by date.
  • Loading branch information
maltekrupa committed Feb 14, 2024
1 parent e9bd227 commit 03a6502
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion do
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,15 @@ function do_deploy {
local version
version="${GITHUB_SHA::7}"
local filename
filename="${RELEASE_NAME}-${version}-${timestamp}"
filename="${RELEASE_NAME}-${timestamp}-${version}"

_scp _build/prod/${RELEASE_NAME}*tar.gz "${DEPLOY_TARGET_SCP}:/tmp/${filename}.tar.gz"
_ssh "mkdir -p /usr/local/${RELEASE_NAME}/$filename"
_ssh "tar xzf /tmp/${filename}.tar.gz -C /usr/local/${RELEASE_NAME}/$filename"
_ssh sudo service ${RELEASE_NAME} stop || true
_ssh "ln -sFf /usr/local/${RELEASE_NAME}/${filename} /usr/local/${RELEASE_NAME}/active"
_ssh "sudo service ${RELEASE_NAME} start > /dev/null 2>&1"
_ssh "rm /tmp/${filename}.tar.gz"
}

function _ssh {
Expand Down

0 comments on commit 03a6502

Please sign in to comment.