Skip to content

Commit

Permalink
Merge pull request #22 from paulrbr-fl/fix-v1.10
Browse files Browse the repository at this point in the history
Upgrade clever tools to latest version
  • Loading branch information
paulrbr-fl authored Jan 14, 2019
2 parents ae84364 + 2baf1a4 commit f23c138
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 82 deletions.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# defaults file for clever
clever_cli_version: 0.9.3
clever_cli_version: 1.3.0
clever_user_path: .local/bin
clever_app_root: "{{ app_root | default(playbook_dir + '/..') }}"
clever_app_confdir: "{{ clever_app_root }}/.clever_cloud"
Expand Down
54 changes: 0 additions & 54 deletions files/clever-wait-deploy.sh

This file was deleted.

60 changes: 34 additions & 26 deletions tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@
tags:
- skip_ansible_lint

- name: Push to Clever-Cloud to trigger deployment
command: "git push --force git+ssh://[email protected]/{{ clever_app }}.git HEAD:refs/heads/master"
- name: Deploy to Clever-Cloud
shell: "clever deploy --force"
args:
chdir: "{{ clever_app_root }}"
register: clever_git_push
environment:
CONFIGURATION_FILE: "{{ clever_login_file }}"
register: clever_deploy
async: 900 # 15 minutes timeout
poll: 30
ignore_errors: true
tags:
- skip_ansible_lint
Expand All @@ -44,35 +48,39 @@
args:
chdir: "{{ clever_app_root }}"
when:
- clever_git_push is failed
- clever_git_push.stderr is search("shallow update not allowed")
- clever_deploy is failed
- clever_deploy.stderr is defined
- clever_deploy.stderr is search("Failed to read git object")
tags:
- skip_ansible_lint

- name: Push to Clever-Cloud to trigger deployment
command: "git push --force git+ssh://[email protected]/{{ clever_app }}.git HEAD:refs/heads/master"
- name: Deploy to Clever-Cloud
shell: "clever deploy --force"
args:
chdir: "{{ clever_app_root }}"
when: clever_git_push is failed
environment:
CONFIGURATION_FILE: "{{ clever_login_file }}"
when: clever_deploy is failed
register: clever_deploy
async: 900 # 15 minutes timeout
poll: 30
ignore_errors: true
tags:
- skip_ansible_lint

- name: Watch deployment status
command: "clever-wait-deploy.sh"
args:
chdir: "{{ clever_app_root }}"
async: 900
poll: 0
register: long_command
environment:
CONFIGURATION_FILE: "{{ clever_login_file }}"
changed_when: False
- name: Return deployment logs
debug:
var: clever_deploy.stdout
when: clever_deploy.stdout is defined

- name: Return deployment errors
debug:
var: clever_deploy.stderr
when:
- clever_deploy is failed
- clever_deploy.stderr is defined

# Waits up to 15 minutes
- name: Wait for deployment completion
async_status:
jid: "{{ long_command.ansible_job_id }}"
register: job_result
until: job_result.finished
delay: 30
retries: 30
- name: Fail on deployment errors
fail:
msg: "The clever deployment failed! Please check logs above."
when: clever_deploy is failed
1 change: 0 additions & 1 deletion tasks/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@
with_items:
- clever-set-domain.sh
- clever-set-drain.sh
- clever-wait-deploy.sh

0 comments on commit f23c138

Please sign in to comment.