From 862d6d2b7e7038df7ec19781dec919693f69e76e Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 23 May 2018 16:38:52 -0300 Subject: Deploy: run hydra install to keep codebase synced --- TODO.md | 1 - share/hydra/deploy | 11 +++++++++++ share/hydra/install | 2 +- share/hydractl/install | 20 ++++++++++---------- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/TODO.md b/TODO.md index d1836f9..4314947 100644 --- a/TODO.md +++ b/TODO.md @@ -7,5 +7,4 @@ TODO * hydra: * deploy: * manage ansible package at local machine - * run hydra install to keep codebase synced * check if server needs import-keys, or always import them 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 < /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 -- cgit v1.2.3