Newer
Older
Zirror-API / docroot / git / push.php
<?php

/*
 * Update Website When Code Is Pushed
 * When comment is prepended with ! it will not pull the push
 *
 */
if (isset ( $_POST ['payload'] )) {
  $pData = json_decode ( $_POST ['payload'] );

  system ( "echo 'Message: " . $pData->head_commit->message . "' >> /tmp/post.log" );

  if ($pData->head_commit->message [0] != '!')
    system ( "cd /usr/web/sites/app.zirror.com/;git pull" );
}

?>