Skip to content

Commit

Permalink
Updating simple dielpy script to handle dev and prod environments
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Weinstein committed Nov 24, 2019
1 parent 1df43fd commit a426a27
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions bin/deploy.sh
@@ -1,7 +1,21 @@
#!/bin/sh

# Sync from home/repo to prod
# Need to run with sudo!
rsync -a --delete /home/pdw/dev.weinstein.org/www/index.php /var/www/html/index.php;
rsync -a --delete /home/pdw/dev.weinstein.org/www/after-dark/ /var/www/html/after-dark;
rsync -a --delete /home/pdw/dev.weinstein.org/lib/ /var/www/lib;
if [[ -z "$1" ]]; then

1>&2 echo "Deploy env arg missing"

elif [[ $1 == "prod" ]]; then

# Sync from home/repo to prod
rsync -a --delete /home/pdw/dev.weinstein.org/www/index.php /var/www/html/index.php;
rsync -a --delete /home/pdw/dev.weinstein.org/www/after-dark/ /var/www/html/after-dark;
rsync -a --delete /home/pdw/dev.weinstein.org/lib/ /var/www/lib;

elif [[ $1 == "dev" ]]; then

# Sync from home/repo to dev
rsync -a --delete /Users/pdw/Sites/dev.weinstein.org/www/index.php /Library/WebServer/Documents/index.php;
rsync -a --delete /Users/pdw/Sites/dev.weinstein.org/www/after-dark/ /Library/WebServer/Documents/after-dark;
rsync -a --delete /Users/pdw/Sites/dev.weinstein.org/lib/ /Library/WebServer/lib;

fi

0 comments on commit a426a27

Please sign in to comment.