Last active
June 14, 2016 12:36
-
-
Save abeyuya/5071638 to your computer and use it in GitHub Desktop.
bitbucketからの自動デプロイ ref: http://qiita.com/abeyuya/items/773c26384297efe1f9a1
This file contains 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 | |
if($_SERVER["REQUEST_METHOD"] != "POST"){ | |
// GETによるアクセス | |
}else{ | |
// POSTによるアクセス | |
$cmd = '. /var/www/html/update.sh'; | |
$retstr = system($cmd, $res); | |
$fp = fopen("deploy.log", "a"); | |
fwrite($fp, date('c')."\n"); | |
if ($retstr === FALSE || 0 !== $res) { | |
fwrite($fp, "cmd false\n"); | |
} else { | |
fwrite($fp, $res."\n"); | |
} | |
fclose($fp); | |
} | |
?> |
This file contains 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
#!/bin/sh | |
cd /var/www/html/[rep-name] | |
/usr/bin/git --git-dir=/var/www/html/[rep-name]/.git pull |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment