]> gitweb.fluxo.info Git - rhatto/apps.git/commitdiff
Inception: deploy to remote hostname
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 17 Sep 2015 17:55:03 +0000 (14:55 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 17 Sep 2015 17:55:03 +0000 (14:55 -0300)
README.md
hydra
inception
vbox

index 19f015a9bdb7f27b69ef533700d6dcc8ce3c4c29..44c1954ebda5edeeaeb6e1049fdde7b8a5c7671c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -29,4 +29,8 @@ Then, after manually checking repository versions:
 
     $HOME/apps/inception load
 
+Once installed locally, you can deploy remotelly using rsync+ssh:
+
+    inception deploy <hostname>
+
 You should have a nice workspace now :)
diff --git a/hydra b/hydra
index ace671aaab66e86568db07a6852ec3aac5a22cd8..955a3ab2b8e6c7555528fe09588e44c45b149597 160000 (submodule)
--- a/hydra
+++ b/hydra
@@ -1 +1 @@
-Subproject commit ace671aaab66e86568db07a6852ec3aac5a22cd8
+Subproject commit 955a3ab2b8e6c7555528fe09588e44c45b149597
index 4191b6d0229f89bd0ee605fc14419157b205945a..a6797d42c880bb59b0574fcf19110c41f63ced7e 100755 (executable)
--- a/inception
+++ b/inception
@@ -8,7 +8,9 @@ BASENAME="`basename $0`"
 DIRNAME="$(cd `dirname $0` &> /dev/null && pwd)"
 
 # Main
-if [ -z "$1" ] || [ "$1" == "init" ]; then
+if [ -z "$1" ]; then
+  echo "usage: $BASENAME <action> [options]"
+elif [ "$1" == "init" ]; then
   (
     cd $DIRNAME
 
@@ -46,4 +48,33 @@ elif [ "$1" == "load" ]; then
   )
 
   echo "Done. Logout and login again to apply all changes."
+elif [ "$1" == "install" ]; then
+  # We could just do that, but we shall make sure that code was verified
+  #$0 init
+  #$0 load
+  echo "Please README!"
+elif [ "$1" == "deploy" ]; then
+  if [ ! -z "$2" ]; then
+    REMOTE="$2"
+    MODULES="`$DIRNAME/metadot/metadot list`"
+
+    # Sync apps
+    if [ -e "$HOME/apps" ]; then
+      rsync -avz --delete $HOME/apps/ $REMOTE:$HOME/apps/
+    fi
+
+    # Sync dotfiles
+    if [ -e "$HOME/.dotfiles" ]; then
+      rsync -avz --delete $HOME/.dotfiles/ $REMOTE:$HOME/.dotfiles/
+    fi
+
+    # Sync loaded modules
+    ssh $REMOTE <<EOF
+    ##### BEGIN REMOTE SCRIPT #####
+    for module in $MODULES; do
+      $HOME/apps/metadot/metadot load $module
+    done
+    ##### END REMOTE SCRIPT #######
+EOF
+  fi
 fi
diff --git a/vbox b/vbox
index d2cf751558216cad14a068d7ed40577ecc9ce639..76e629a7545b021cb47a63f17ee61c2ed9aec386 160000 (submodule)
--- a/vbox
+++ b/vbox
@@ -1 +1 @@
-Subproject commit d2cf751558216cad14a068d7ed40577ecc9ce639
+Subproject commit 76e629a7545b021cb47a63f17ee61c2ed9aec386