Skip to content

Instantly share code, notes, and snippets.

@maximevalette
Created October 13, 2011 19:39
Show Gist options
  • Save maximevalette/1285288 to your computer and use it in GitHub Desktop.
Save maximevalette/1285288 to your computer and use it in GitHub Desktop.
Utiliser git avec des sites Web
repo monsite.com
RW+ = maxime stagiaire
R = stagiaire
RW+ NAME/ = maxime
R NAME/ = stagiaire
RW+ refs/heads/develop NAME/ = stagiaire
#!/bin/sh
git push origin
#!/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
#!/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