]>
git.immae.eu Git - github/fretlink/ansible-clever.git/blob - files/clever-wait-deploy.sh
7 timeout
=2300 # 100 seconds less than the Ansible tasks' timeout
10 function cleverActivity
{
11 lastCleverActivity
=$(clever activity)
15 local lastReturnCode
="$?"
22 if [ "$lastReturnCode" == "0" ]
24 echo "✓ Deployment done."
26 echo "✗ Deployment failed!"
29 echo "⁈ Deployment timeout... Please check clever logs"
34 function isNotTimeout
{
35 [ $(($(date +%s) - startTime
)) -lt $timeout ]
41 checkStatus
"$1" "IN PROGRESS"
49 checkStatus
"$1" "" "-v"
52 function checkStatus
{
57 echo "${lastCleverActivity}" | tail -n1 | grep ${3:+ "${3}"} -q -E "${status}.*DEPLOY.*${commit}"
61 if [ -n "${VERBOSE}" ]; then
62 echo -e "\\nLast clever activity:"
63 echo -e "${lastCleverActivity}\\n"
71 echo "️▫ Waiting for deployment to start..."
72 while inactive
"$commit" && isNotTimeout
79 echo "▪ Deployment in progress..."
80 while deploying
"$commit" && isNotTimeout
92 git
--git-dir="$chdir" rev-parse HEAD
96 check
"$(getHeadRev "${workdir}")"