From c5aed75a0e5732aa6031ce3b1864d5aee3e1b49e Mon Sep 17 00:00:00 2001 From: Paul Bonaud Date: Wed, 21 Nov 2018 13:20:56 +0100 Subject: deploy_task: Update clever CLI tools and use it instead of git push Updating to latest version of 1.1.1 helps to have a stable `clever deploy` command. This commit relies on the output of the command instead of manually pooling the results with `clever activity` command. --- files/clever-wait-deploy.sh | 54 --------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100755 files/clever-wait-deploy.sh (limited to 'files') diff --git a/files/clever-wait-deploy.sh b/files/clever-wait-deploy.sh deleted file mode 100755 index b911069..0000000 --- a/files/clever-wait-deploy.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -e - -function deploying { - checkStatus "$1" "IN PROGRESS" -} - -function deployed { - checkStatus "$1" "OK" -} - -function inactive { - local commit="$1" - [[ "$(clever activity | grep "$commit" | grep "DEPLOY" | wc -l)" == "0" ]] -} - -function checkStatus { - local commit="$1" - local status="$2" - [[ "$(clever activity | grep "$commit" | grep "${status}\s\+DEPLOY" | wc -l)" == "1" ]] -} - -function check { - local timeout=600 # 10 minutes - local commit="$1" - local samplingTime=5 - - echo "Waiting for deployment start..." - while inactive "$commit" -a $timeout -gt 0 - do - sleep $samplingTime - let "timeout-=$samplingTime" - done - - # Wait for completion - echo "Deployment in progress..." - while deploying "$commit" -a $timeout -gt 0 - do - sleep $samplingTime - let "timeout-=$samplingTime" - done - - if [ $samplingTime -eq 0 ] - then - echo "Timeout" - fi - - deployed "$commit" -} - -function getHeadRev { - git rev-parse HEAD -} - -check "$(getHeadRev)" -- cgit v1.2.3