Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Commit

Permalink
hook script now working
Browse files Browse the repository at this point in the history
  • Loading branch information
Erika Heidi committed May 8, 2014
1 parent 564caba commit 725a9c2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions logs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
16 changes: 16 additions & 0 deletions webtools/github/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require_once __DIR__ . '/../../vendor/autoload.php';

$app = new Silex\Application();
$app['debug'] = true;

$app->get('/', function () use ($app) {
return 'Nothing to see here.';
Expand All @@ -14,6 +15,21 @@
* 1 - cd to /dev-human/dev-human and pull from main repo
* 2 - run the sculpin command and generate the prod output
*/

$local_path = "/www/dev-human/dev-human";
//$local_path = "/home/erika/Projects/dev-human";
$update_log = __DIR__ . '/../../logs/update.log';

shell_exec("cd $local_path && git pull 2>&1");
shell_exec("cd $local_path && sculpin generate --env=prod 2>&1");

$fp = fopen($update_log, "a+");
if ($fp !== false) {
fwrite($fp, date('[Y-m-d H:i:s]') . " Updated production website.\n");
fclose($fp);
}

return new \Symfony\Component\HttpFoundation\Response("Done.");
});

$app->run();

0 comments on commit 725a9c2

Please sign in to comment.