forked from angular/angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitFetchSite.php
34 lines (32 loc) · 1.01 KB
/
gitFetchSite.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html>
<head>
<title>Update site from: GitHub master</title>
</head>
<body>
<?php `echo ================================== >> gitFetchSite.log`; ?>
<?php `date >> gitFetchSite.log`; ?>
<pre><?php echo `date`; ?></pre>
<pre><?php echo `git fetch origin`; ?></pre>
<pre><?php echo `git checkout origin/master -f`; ?></pre>
<pre><?php echo `git status`; ?></pre>
<pre><?php echo `git log -n1`; ?></pre>
<!--
Cluster-friendly propagation.
Works with existing Git hooks.
The request from the git hook will not
contain the doNotPropagate parameter,
which will cause this PHP script to call
a node script that will tell other instances
to update themselves, but not to propagate the
change to other instances.
-->
<pre><?php if($_GET['doNotPropagate'] != 'true') {
echo 'Propagating to other intances';
echo `node propagateClusterUpdate.js`;
} else {
echo 'Not Propagating to other instances';
}
?></pre>
<?php `git log -n1 >> gitFetchSite.log`; ?>
</body>
</html>