Skip to content

Instantly share code, notes, and snippets.

@keithmancuso
Created February 24, 2018 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keithmancuso/3f1bf475cc71a6081026487cc7e32a42 to your computer and use it in GitHub Desktop.
Save keithmancuso/3f1bf475cc71a6081026487cc7e32a42 to your computer and use it in GitHub Desktop.
if [ -d "releases/${execution.to_revision.revision}" ] && [ "${execution.refresh}" = "true" ]; then echo "Removing: releases/${execution.to_revision.revision}" && rm -rf releases/${execution.to_revision.revision}; fi
if [ ! -d "releases/${execution.to_revision.revision}" ]; then echo "Creating: releases/${execution.to_revision.revision}" && cp -dR deploy-cache releases/${execution.to_revision.revision}; fi
echo "Linking current to revision: ${execution.to_revision.revision}"
rm -f current
ln -s releases/${execution.to_revision.revision} current
echo "Removing old releases"
cd releases && ls -t | tail -n +11 | xargs rm -rf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment