Created
November 1, 2012 01:11
-
-
Save MikePearce/3990990 to your computer and use it in GitHub Desktop.
Basic post-receive hook
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
#!/usr/local/bin/php | |
<?php | |
$staging_directory = '/var/www/engni_test/'; | |
$webroot_directory = '/var/www/engni_test_live/'; | |
echo "****************************************************\n"; | |
echo "*** BEGIN POST-RECEIVE\n"; | |
echo "****************************************************\n"; | |
echo "*** 1. checkout test\n"; | |
echo `git --work-tree=$staging_directory checkout -f`; | |
echo "*** 2. Get the vendor crap\n"; | |
echo `cd $staging_directory; curl -s http://getcomposer.org/installer | php -- --quiet; php composer.phar install -n`; | |
echo "*** 3. sort out the cache (reset & warm)\n"; | |
echo `php $staging_directory/app/console cache:clear`; | |
echo `php $staging_directory/app/console cache:warm`; | |
//echo "*** 3. Move directory\n"; | |
//echo `mv $live_directory $webroot_directory`; | |
echo "*** COMPLETE! **************************************\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment