Created
May 14, 2015 11:32
-
-
Save micahwalter/d683f3e87543a074eb9a to your computer and use it in GitHub Desktop.
post receive deploy hook
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 | |
# Check out the code on this server. | |
GIT_WORK_TREE=/home/git/working/<username>/<projectname> git checkout -f | |
# Define an array of servers to which the code will be deployed. | |
SERVERS="abc.example.com, xyz.example.com" | |
# Push codebase to the servers via rsync. | |
for SERVER in $SERVERS | |
do | |
/usr/bin/rsync -av --delete --exclude file-to-exclude.txt -e ssh /home/git/working/<username>/<projectname> username@$SERVER:/<target>/<folder> | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment