Skip to content

Instantly share code, notes, and snippets.

@tomat
Last active January 2, 2017 15:48
Show Gist options
  • Select an option

  • Save tomat/e416dfe0286a7ff0bb1ba1b884d984b3 to your computer and use it in GitHub Desktop.

Select an option

Save tomat/e416dfe0286a7ff0bb1ba1b884d984b3 to your computer and use it in GitHub Desktop.
cd {{project}}
# Remove dots from branch name (one may want to do more cleaning here)
branch=$(echo "{{branch}}"|sed "s/\.//g")
if [ "$branch" != "master" ]; then
# Replace the current symlink with the one we saved before
mv -T current_archived current
# Make sure the branches directory exists
mkdir -p "branches"
# Remove previous deployment of this specific branch
rm -rf "branches/$branch"
# Move this release to the branch directory
mv "{{release}}" "branches/$branch"
# (optional) Warm up cache again because the path changed
cd "branches/$branch"
php app/console ca:cl --env=prod
fi
# Reload php-fpm manually instead of letting Envoyer do it
sudo service php-fpm reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment