diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-03-16 10:41:50 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-03-16 10:41:50 -0300 |
commit | 541ab8db9a04dc23c86b5fa5763d5729c22774f0 (patch) | |
tree | 57e91d217d59d99bf1c49174f66ac8c5b50a4cd1 | |
parent | d68557b61bab14cc0d56868a7745dccd548ee4a7 (diff) | |
download | apps-541ab8db9a04dc23c86b5fa5763d5729c22774f0.tar.gz apps-541ab8db9a04dc23c86b5fa5763d5729c22774f0.tar.bz2 |
Inception: deploy: support for multiple remotes
-rwxr-xr-x | inception | 38 |
1 files changed, 21 insertions, 17 deletions
@@ -84,27 +84,31 @@ function inception_install { # Deploy function inception_deploy { if [ ! -z "$2" ]; then - REMOTE="$2" - MODULES="`$DIRNAME/metadot/metadot installed | xargs`" + REMOTES="$*" - # Sync apps - if [ -e "$HOME/apps" ]; then - rsync -avz --delete $HOME/apps/ $REMOTE:apps/ - fi + for REMOTE in $REMOTES; do + REMOTE="$2" + MODULES="`$DIRNAME/metadot/metadot installed | xargs`" - # Sync dotfiles - if [ -e "$HOME/.dotfiles" ]; then - rsync -avz --delete $HOME/.dotfiles/ $REMOTE:.dotfiles/ - fi + # Sync apps + if [ -e "$HOME/apps" ]; then + rsync -avz --delete $HOME/apps/ $REMOTE:apps/ + fi - # Sync loaded modules - ssh -T $REMOTE <<EOF - ##### BEGIN REMOTE SCRIPT ##### - for module in $MODULES; do - \$HOME/apps/metadot/metadot load \$module - done - ##### END REMOTE SCRIPT ####### + # Sync dotfiles + if [ -e "$HOME/.dotfiles" ]; then + rsync -avz --delete $HOME/.dotfiles/ $REMOTE:.dotfiles/ + fi + + # Sync loaded modules + ssh -T $REMOTE <<EOF + ##### BEGIN REMOTE SCRIPT ##### + for module in $MODULES; do + \$HOME/apps/metadot/metadot load \$module + done + ##### END REMOTE SCRIPT ####### EOF + done fi } |