Forked from mickaelandrieu/stupid_deployement_script.php
Last active
March 1, 2016 16:51
-
-
Save xorus/5c2d5f885e3a8d946f36 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| // ultra basique et non sécurisé | |
| if($_SERVER['REQUEST_METHOD'] === 'POST' && $_SERVER['HTTP_X_GITHUB_EVENT'] == 'push'){ | |
| $path = getProjectPath(); | |
| exec("cd ".$path." && git pull origin master"); | |
| } | |
| } | |
| /** | |
| * Dépend de l'endroit où le projet est cloné en SSH | |
| */ | |
| function getProjectPath() | |
| { | |
| return __DIR__.DIRECTORY_SEPARATOR.'projet-1'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment