Last active
January 2, 2017 15:48
-
-
Save tomat/e416dfe0286a7ff0bb1ba1b884d984b3 to your computer and use it in GitHub Desktop.
https://medium.com/@tomat/dynamic-git-branch-subdomains-with-laravel-envoyer-and-apache-f963691e1dc5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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