diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2015-09-17 14:55:03 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2015-09-17 14:55:03 -0300 |
commit | 7419c99cab3bd9a9f8a69fe1da5897897444e705 (patch) | |
tree | 04e47ad22d33d736c642187a3cbd154c55dd05f7 /inception | |
parent | 46443babffaf1512e554ff1342d582658973fa04 (diff) | |
download | apps-7419c99cab3bd9a9f8a69fe1da5897897444e705.tar.gz apps-7419c99cab3bd9a9f8a69fe1da5897897444e705.tar.bz2 |
Inception: deploy to remote hostname
Diffstat (limited to 'inception')
-rwxr-xr-x | inception | 33 |
1 files changed, 32 insertions, 1 deletions
@@ -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 |