Skip to content

Instantly share code, notes, and snippets.

@MikePearce
Created November 1, 2012 01:11
Show Gist options
  • Save MikePearce/3990990 to your computer and use it in GitHub Desktop.
Save MikePearce/3990990 to your computer and use it in GitHub Desktop.
Basic post-receive hook
#!/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