aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-05-23 16:38:52 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-05-23 16:38:52 -0300
commit862d6d2b7e7038df7ec19781dec919693f69e76e (patch)
treefbebb88434df0b6974c85628a2017bf819eba88c /share
parent906b6cabbcd5d507ac96cc79e62d394d5e5011e1 (diff)
downloadhydra-862d6d2b7e7038df7ec19781dec919693f69e76e.tar.gz
hydra-862d6d2b7e7038df7ec19781dec919693f69e76e.tar.bz2
Deploy: run hydra install to keep codebase synced
Diffstat (limited to 'share')
-rwxr-xr-xshare/hydra/deploy11
-rwxr-xr-xshare/hydra/install2
-rwxr-xr-xshare/hydractl/install20
3 files changed, 22 insertions, 11 deletions
diff --git a/share/hydra/deploy b/share/hydra/deploy
index 093b723..32dc700 100755
--- a/share/hydra/deploy
+++ b/share/hydra/deploy
@@ -66,6 +66,10 @@ for node in $NODES; do
# Create folders
hydra_deploy_mkdirs
+ # Ensure we have a compatible hydra suite
+ #hydra $HYDRA install $node
+ DESTDIR="$FOLDER" hydractl install
+
# Sync repository to server
echo "Syncing configuration..."
$DEPLOY_RSYNC "$RSYNC_PATH" $DEPLOY_OPTS
@@ -100,6 +104,10 @@ for node in $NODES; do
$SUDO apt-get install $DEPLOY_DEPENDENCIES -y
fi
+ # Ensure we have a compatible hydra suite
+ #hydra $HYDRA install $node
+ hydractl install
+
# Collect facts
hydra_deploy_facts_collect local
@@ -124,6 +132,9 @@ for node in $NODES; do
continue
fi
+ # Ensure we have a compatible hydra suite
+ hydra $HYDRA install $node
+
# Check remote environment
$HYDRA_CONNECT $FQDN <<EOF
##### BEGIN REMOTE SCRIPT #####
diff --git a/share/hydra/install b/share/hydra/install
index cfa480c..a5f1eef 100755
--- a/share/hydra/install
+++ b/share/hydra/install
@@ -43,7 +43,7 @@ fi
# Deploy
for node in $NODES; do
- echo "Installing to $node..."
+ echo "Installing Hydra Suite into $node..."
# Handles localhost
if [ "$node" == "localhost" ] || [ "$node" == "`facter fqdn`" ] || [ "$node" == "`facter hostname`" ]; then
diff --git a/share/hydractl/install b/share/hydractl/install
index fb7f0b9..1e70180 100755
--- a/share/hydractl/install
+++ b/share/hydractl/install
@@ -33,20 +33,20 @@ if ! which git &> /dev/null; then
fi
# 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/
+if [ "$APP_BASE" != "$DESTDIR/usr/local/share/hydra" ]; then
+ echo "Installing Hydra Suite into $DESTDIR/usr/local/share/hydra..."
+ $sudo rsync -av --delete $APP_BASE/ $DESTDIR/usr/local/share/hydra/
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
+$sudo ln -sf /usr/local/share/hydra/hydra $DESTDIR/usr/local/bin/hydra
+$sudo ln -sf /usr/local/share/hydra/hydra $DESTDIR/usr/local/bin/hydractl
+$sudo ln -sf /usr/local/share/hydra/hydras $DESTDIR/usr/local/bin/hydras
# Remove from old locations
# We're 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
+$sudo rm -fr $DESTDIR/usr/local/hydra
+$sudo rm -f $DESTDIR/usr/local/sbin/hydra
+$sudo rm -f $DESTDIR/usr/local/sbin/hydractl
+$sudo rm -f $DESTDIR/usr/local/sbin/hydras