Created
August 14, 2013 06:50
-
-
Save p4ul/6228590 to your computer and use it in GitHub Desktop.
quick in dirty self updater for use with github webhooks
This file contains 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
<pre> | |
<?php | |
// ---------------------- CONFIG DETAILS ---------------------- | |
//branch in git | |
$BRANCH = 'master'; | |
// --------- You should not need to edit below here ------------ | |
$current_sha1 = `git rev-parse $BRANCH`; | |
$status_of_branch = `git ls-remote origin -h refs/heads/$BRANCH`; | |
if( strpos(trim($status_of_branch), trim($current_sha1)) !== false) { | |
echo "no changes on branch $BRANCH \n"; | |
return; | |
} | |
echo "Pulling\n"; | |
$pull = `git pull`; | |
echo ".\n"; | |
echo "Clearing Cache\n"; | |
$cache = `drush cc all`; | |
echo ".\n"; | |
echo "Finished \n"; | |
echo "pull:". $pull , "\n"; | |
echo "cache:".$cache , "\n"; | |
$sha1 = `git rev-parse $BRANCH`; | |
$changelog = `git log $BRANCH -1 --format="%s"`; | |
echo "sha1:". $sha1 , "\n"; | |
echo "changelog:".$changelog , "\n"; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment