2017-09-26 07:14:39 +00:00
|
|
|
<?php
|
2017-09-26 08:24:08 +00:00
|
|
|
/**
|
|
|
|
* GIT DEPLOYMENT SCRIPT
|
|
|
|
*
|
|
|
|
* Used for automatically deploying websites via github or bitbucket, more deets here:
|
|
|
|
*
|
|
|
|
* https://gist.github.com/1809044
|
|
|
|
*/
|
|
|
|
// The commands
|
|
|
|
$commands = array(
|
|
|
|
'echo $PWD',
|
|
|
|
'whoami',
|
|
|
|
'git pull',
|
|
|
|
'git status',
|
|
|
|
'git submodule sync',
|
|
|
|
'git submodule update',
|
|
|
|
'git submodule status',
|
|
|
|
);
|
|
|
|
// Run the commands for output
|
|
|
|
$output = '';
|
|
|
|
foreach($commands AS $command){
|
|
|
|
// Run it
|
2017-09-26 09:14:06 +00:00
|
|
|
$tmp = shell_exec($command.' 2>&1');
|
2017-09-26 08:24:08 +00:00
|
|
|
// Output
|
|
|
|
$output .= "<span style=\"color: #6BE234;\">\$</span> <span style=\"color: #729FCF;\">{$command}\n</span>";
|
|
|
|
$output .= htmlentities(trim($tmp)) . "\n";
|
|
|
|
}
|
|
|
|
// Make it pretty for manual user access (and why not?)
|
2017-09-26 07:14:39 +00:00
|
|
|
?>
|
2017-09-26 08:24:08 +00:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html lang="en-US">
|
2017-09-26 07:14:39 +00:00
|
|
|
<head>
|
2017-09-26 08:24:08 +00:00
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>GIT DEPLOYMENT SCRIPT</title>
|
2017-09-26 07:14:39 +00:00
|
|
|
</head>
|
2017-09-26 08:24:08 +00:00
|
|
|
<body style="background-color: #000000; color: #FFFFFF; font-weight: bold; padding: 0 10px;">
|
2017-09-26 07:14:39 +00:00
|
|
|
<pre>
|
2017-09-26 08:24:08 +00:00
|
|
|
. ____ . ____________________________
|
|
|
|
|/ \| | |
|
|
|
|
[| <span style="color: #FF0000;">♥ ♥</span> |] | Git Deployment Script v0.1 |
|
2017-09-26 09:01:16 +00:00
|
|
|
|___==___| / |
|
2017-09-26 08:24:08 +00:00
|
|
|
|____________________________|
|
2017-09-26 07:14:39 +00:00
|
|
|
|
2017-09-26 08:24:08 +00:00
|
|
|
<?php echo $output; ?>
|
2017-09-26 07:14:39 +00:00
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|