diff options
author | paulrbr-fl <43074087+paulrbr-fl@users.noreply.github.com> | 2019-01-14 11:32:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-14 11:32:47 +0100 |
commit | f23c13859727da0010fb668a9bb9d41ad56203e6 (patch) | |
tree | 11a0548fbb60388eaaed88a3798a2bea4fee589f /files | |
parent | ae84364c02907d17867f2a47cf409ad0a2172af5 (diff) | |
parent | 2baf1a4a13c76331c069a04d7ad89377c4104ea5 (diff) | |
download | ansible-clever-f23c13859727da0010fb668a9bb9d41ad56203e6.tar.gz ansible-clever-f23c13859727da0010fb668a9bb9d41ad56203e6.tar.zst ansible-clever-f23c13859727da0010fb668a9bb9d41ad56203e6.zip |
Merge pull request #22 from paulrbr-fl/fix-v1.10v1.15
Upgrade clever tools to latest version
Diffstat (limited to 'files')
-rwxr-xr-x | files/clever-wait-deploy.sh | 54 |
1 files changed, 0 insertions, 54 deletions
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 @@ | |||
1 | #!/bin/bash -e | ||
2 | |||
3 | function deploying { | ||
4 | checkStatus "$1" "IN PROGRESS" | ||
5 | } | ||
6 | |||
7 | function deployed { | ||
8 | checkStatus "$1" "OK" | ||
9 | } | ||
10 | |||
11 | function inactive { | ||
12 | local commit="$1" | ||
13 | [[ "$(clever activity | grep "$commit" | grep "DEPLOY" | wc -l)" == "0" ]] | ||
14 | } | ||
15 | |||
16 | function checkStatus { | ||
17 | local commit="$1" | ||
18 | local status="$2" | ||
19 | [[ "$(clever activity | grep "$commit" | grep "${status}\s\+DEPLOY" | wc -l)" == "1" ]] | ||
20 | } | ||
21 | |||
22 | function check { | ||
23 | local timeout=600 # 10 minutes | ||
24 | local commit="$1" | ||
25 | local samplingTime=5 | ||
26 | |||
27 | echo "Waiting for deployment start..." | ||
28 | while inactive "$commit" -a $timeout -gt 0 | ||
29 | do | ||
30 | sleep $samplingTime | ||
31 | let "timeout-=$samplingTime" | ||
32 | done | ||
33 | |||
34 | # Wait for completion | ||
35 | echo "Deployment in progress..." | ||
36 | while deploying "$commit" -a $timeout -gt 0 | ||
37 | do | ||
38 | sleep $samplingTime | ||
39 | let "timeout-=$samplingTime" | ||
40 | done | ||
41 | |||
42 | if [ $samplingTime -eq 0 ] | ||
43 | then | ||
44 | echo "Timeout" | ||
45 | fi | ||
46 | |||
47 | deployed "$commit" | ||
48 | } | ||
49 | |||
50 | function getHeadRev { | ||
51 | git rev-parse HEAD | ||
52 | } | ||
53 | |||
54 | check "$(getHeadRev)" | ||