aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-03-16 10:41:50 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-03-16 10:41:50 -0300
commit541ab8db9a04dc23c86b5fa5763d5729c22774f0 (patch)
tree57e91d217d59d99bf1c49174f66ac8c5b50a4cd1
parentd68557b61bab14cc0d56868a7745dccd548ee4a7 (diff)
downloadapps-541ab8db9a04dc23c86b5fa5763d5729c22774f0.tar.gz
apps-541ab8db9a04dc23c86b5fa5763d5729c22774f0.tar.bz2
Inception: deploy: support for multiple remotes
-rwxr-xr-xinception38
1 files changed, 21 insertions, 17 deletions
diff --git a/inception b/inception
index f879166..3d54387 100755
--- a/inception
+++ b/inception
@@ -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
}