aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-06-16 16:19:24 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-06-16 16:19:24 -0300
commit2c8ec73df36323d4a58df8cfe30302ecca2722d7 (patch)
tree99730042bd4a2384e7d0bf11ca58fb422433fa9f /share
parentc4f04a396dea31b84cf641b8e3c66184fd3f3531 (diff)
downloadhydra-2c8ec73df36323d4a58df8cfe30302ecca2722d7.tar.gz
hydra-2c8ec73df36323d4a58df8cfe30302ecca2722d7.tar.bz2
Install: merge hydractl/hydra codebase
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/install32
-rwxr-xr-xshare/hydractl/install34
2 files changed, 19 insertions, 47 deletions
diff --git a/share/hydra/install b/share/hydra/install
index 46fbb72..def34ed 100755
--- a/share/hydra/install
+++ b/share/hydra/install
@@ -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
diff --git a/share/hydractl/install b/share/hydractl/install
index 00298e3..4e05848 100755
--- a/share/hydractl/install
+++ b/share/hydractl/install
@@ -20,26 +20,23 @@
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