]> gitweb.fluxo.info Git - hydra.git/commitdiff
Install: merge hydractl/hydra codebase
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 16 Jun 2016 19:19:24 +0000 (16:19 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 16 Jun 2016 19:19:24 +0000 (16:19 -0300)
share/hydra/install
share/hydractl/install

index 46fbb727f8577af7c48f96ff595dc3c1a0147b6a..def34edadd9b565f0891349516cd0a9a2f8c4d0e 100755 (executable)
@@ -45,34 +45,6 @@ for node in $NODES; do
   # Rsync version
   rsync -rltDv --no-perms --delete --rsync-path "sudo rsync" $APP_BASE/ $node:/usr/local/share/hydra/
 
-  $HYDRA_CONNECT $node <<EOF
-  ##### BEGIN REMOTE SCRIPT #####
-  if ! which git &> /dev/null; then
-    echo "Installing git..."
-    sudo apt-get update
-    sudo apt-get install git-core -y
-  fi
-
-  # Git version
-  #if [ ! -d /usr/local/share/hydra ]; then
-  #  sudo git clone $ORIGIN /usr/local/share/hydra
-  #  ( cd /usr/local/share/hydra ; sudo git reset --hard $COMMIT )
-  #else
-  #  ( cd /usr/local/share/hydra ; sudo git pull ; sudo git reset --hard $COMMIT )
-  #fi
-
-  # Update symlinks
-  sudo ln -sf /usr/local/share/hydra/hydra  /usr/local/bin/hydra
-  sudo ln -sf /usr/local/share/hydra/hydra  /usr/local/bin/hydractl
-  sudo ln -sf /usr/local/share/hydra/hydras /usr/local/bin/hydras
-
-  # Remove from old locations
-  # We keep hydra on /usr/local/bin as /usr/local/sbin might
-  # not be available on $PATH when connecting to a remote system.
-  sudo rm -fr /usr/local/hydra
-  sudo rm -f  /usr/local/sbin/hydra
-  sudo rm -f  /usr/local/sbin/hydractl
-  sudo rm -f  /usr/local/sbin/hydras
-  ##### END REMOTE SCRIPT #######
-EOF
+  # Proceed installation remotely
+  $HYDRA_CONNECT $node /usr/local/share/hydra/hydractl install
 done
index 00298e3f5dfdbf934632f6c44464125734c2a810..4e058489ef459f9bdffafaf83eb080e96f78f161 100755 (executable)
 source $APP_BASE/lib/hydra/functions || exit 1
 hydra_config_load
 
-# Validation
-if [ -z "$ORIGIN" ]; then
-  ORIGIN="git://git.fluxo.info/hydra.git"
-fi
-
 # Set sudo config
 if [ "`whoami`" != 'root' ]; then
   sudo="sudo"
 fi
 
-# Deploy
-echo "Installing to local node..."
-
-if ! which git &> /dev/null; then
-  echo "Installing git..."
-  $sudo apt-get update
-  $sudo apt-get install git-core -y
-fi
-
-# Git version
+# Deploy, git version
+#
+#if ! which git &> /dev/null; then
+#  echo "Installing git..."
+#  $sudo apt-get update
+#  $sudo apt-get install git -y
+#fi
+#
+#if [ -z "$ORIGIN" ]; then
+#  ORIGIN="git://git.fluxo.info/hydra.git"
+#fi
+#
 #if [ ! -d /usr/local/share/hydra ]; then
 #  $sudo git clone $ORIGIN /usr/local/share/hydra
 #  ( cd /usr/local/share/hydra ; $sudo git reset --hard $COMMIT )
@@ -47,8 +44,11 @@ fi
 #  ( cd /usr/local/share/hydra ; $sudo git pull ; $sudo git reset --hard $COMMIT )
 #fi
 
-# Rsync version
-$sudo rsync -av --delete $APP_BASE/ /usr/local/share/hydra/
+# Deploy, rsync version
+if [ "$APP_BASE" != "/usr/local/share/hydra" ]; then
+  echo "Installing into /usr/local/share/hydra..."
+  $sudo rsync -av --delete $APP_BASE/ /usr/local/share/hydra/
+fi
 
 # Update symlinks
 $sudo ln -sf /usr/local/share/hydra/hydra  /usr/local/bin/hydra