Created
January 5, 2013 09:48
-
-
Save mattattui/4460787 to your computer and use it in GitHub Desktop.
Simple default-safe rsync deployment script
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/bash | |
# Will add --dry-run unless the --go option is set. All other arguments passed to rsync (e.g. --delete) | |
SOURCE=. | |
DEST=example.com:/var/www/mysite | |
DRYRUN="--dry-run" | |
args=() | |
for var in "$@" | |
do | |
if [ $var == "--go" ] | |
then | |
DRYRUN="" | |
else | |
args=( "${args[@]}" "$var" ) | |
fi | |
done | |
/usr/bin/env rsync -azCcO --force --progress --exclude-from=rsync_exclude.txt $DRYRUN "${args[@]}" "$SOURCE" "$DEST" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Obviously this is for relatively simple deployments. At the other end of the scale, Capifony is a powerful Ruby-based configurable solution for managing Symfony & Symfony2 deployments to multiple servers and can do stuff like provide atomic, reversible deployments, and run scripts (like database migrations, Composer update, or your test suite). If that's too complicated and this script is too simple, Anchour may suit you better.