Created
October 13, 2011 19:39
-
-
Save maximevalette/1285288 to your computer and use it in GitHub Desktop.
Utiliser git avec des sites Web
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
repo monsite.com | |
RW+ = maxime stagiaire | |
R = stagiaire | |
RW+ NAME/ = maxime | |
R NAME/ = stagiaire | |
RW+ refs/heads/develop NAME/ = stagiaire |
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 | |
git push origin |
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 | |
read oldrev newrev refname | |
BRANCH=${refname#refs/heads/} | |
if [ "$BRANCH" = "master" ] | |
then | |
cd /home/www/monsite.com || exit | |
unset GIT_DIR | |
sudo -u www-data git pull origin master | |
else | |
ssh preprod /home/www/preprod.sh monsite.com | |
fi |
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 | |
die () { | |
echo >&2 "$@" | |
exit 1 | |
} | |
[ "$#" -eq 1 ] || die "1 argument required, $# provided" | |
cd /home/www/$1 | |
git pull | |
cd .. | |
chown -R www-data:www-data $1 | |
/etc/init.d/memcached restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment