Skip to content

Instantly share code, notes, and snippets.

@ariela
Created May 20, 2011 05:03
Show Gist options
  • Save ariela/982388 to your computer and use it in GitHub Desktop.
Save ariela/982388 to your computer and use it in GitHub Desktop.
gitにpushしたwebサイトを自動的に同期させる
#!/bin/sh
wget -q -O - http://APIのURL
<?php
$cmd = dirname(__FILE__) . '/update.sh';
$res = system($cmd);
if (false === $res) {
echo "NG\n";
} else {
echo "OK:{$res}\n";
}
#!/bin/sh
cd /var/www/html/
/usr/bin/git --git-dir=/var/www/html/.git pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment