aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFrédéric Menou <frederic.menou@fretlink.com>2018-03-30 23:48:43 +0200
committerGitHub <noreply@github.com>2018-03-30 23:48:43 +0200
commit3910b408f30bb3b21911a01356fd9994b511990b (patch)
treefbf126bef733eb797bb2b1b433ad7f924fc80cb0
parent7e33cb51e8c911d6f10b226282b7dbc58c13532f (diff)
parentd7d8a988fe5640c5ffa01e1e690516cd201665a5 (diff)
downloadansible-clever-3910b408f30bb3b21911a01356fd9994b511990b.tar.gz
ansible-clever-3910b408f30bb3b21911a01356fd9994b511990b.tar.zst
ansible-clever-3910b408f30bb3b21911a01356fd9994b511990b.zip
Merge pull request #7 from fmenou/better-wait-deployv1.1
Better wait deploy - take #2
-rw-r--r--files/clever-wait-deploy.sh2
-rw-r--r--tasks/deploy.yml14
2 files changed, 14 insertions, 2 deletions
diff --git a/files/clever-wait-deploy.sh b/files/clever-wait-deploy.sh
index 99088cc..c955f6a 100644
--- a/files/clever-wait-deploy.sh
+++ b/files/clever-wait-deploy.sh
@@ -32,7 +32,7 @@ function check {
32 done 32 done
33 33
34 # Wait for completion 34 # Wait for completion
35 echo "Deployement in progress..." 35 echo "Deployment in progress..."
36 while deploying "$commit" -a $timeout -gt 0 36 while deploying "$commit" -a $timeout -gt 0
37 do 37 do
38 sleep $samplingTime 38 sleep $samplingTime
diff --git a/tasks/deploy.yml b/tasks/deploy.yml
index 8b98d8c..54c04ac 100644
--- a/tasks/deploy.yml
+++ b/tasks/deploy.yml
@@ -24,7 +24,19 @@
24- name: Push to Clever-Cloud to trigger deployment 24- name: Push to Clever-Cloud to trigger deployment
25 command: "git push --force git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/{{ clever_app }}.git HEAD:refs/heads/master" 25 command: "git push --force git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/{{ clever_app }}.git HEAD:refs/heads/master"
26 26
27- name: Wait until deployment completion 27- name: Watch deployment status
28 command: clever-wait-deploy.sh 28 command: clever-wait-deploy.sh
29 async: 900
30 poll: 0
31 register: long_command
29 environment: 32 environment:
30 CONFIGURATION_FILE: "{{ clever_login_file }}" 33 CONFIGURATION_FILE: "{{ clever_login_file }}"
34
35# Waits up to 15 minutes
36- name: Wait for deployment completion
37 async_status:
38 jid: "{{ long_command.ansible_job_id }}"
39 register: job_result
40 until: job_result.finished
41 delay: 30
42 retries: 30