Skip to content

Commit

Permalink
Detect New state when querying for queued build
Browse files Browse the repository at this point in the history
It is possible for a build to have a New state when we query it the first time. We need to detect this and keep waiting

TASK [os_temps : debug] ********
ok: [localhost] => {
    "msg": "End result of building the container image :: jenkins-cvp-slave-1   Docker    Git@CVP-133-func-tests-3   New (CannotRetrieveServiceAccount)             "
}
  • Loading branch information
scoheb committed Jun 20, 2018
1 parent 93d6838 commit 6d0c0d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion playbooks/roles/os_temps/tasks/build_new_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- name: "{{ container_config_name }} :: Wait for {{ build_config_name_file.stdout }} to be queued"
shell: "{{ oc_bin }} get builds | grep '{{ build_config_name_file.stdout }}'"
register: oc_build_result
until: oc_build_result.stdout.find(" Pending ") == -1
until: (oc_build_result.stdout.find(" Pending ") == -1 or oc_build_result.stdout.find(" New ") == -1)
retries: 6
delay: 10
ignore_errors: yes
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/os_temps/tasks/setup_os_templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
- name: "{{ container_config_name }} :: Wait for {{ build_config_name_file.stdout }} to be queued :: FINAL ATTEMPT"
shell: "{{ oc_bin }} get builds | grep '{{ build_config_name_file.stdout }}'"
register: oc_build_result
until: oc_build_result.stdout.find(" Pending ") == -1
until: (oc_build_result.stdout.find(" Pending ") == -1 or oc_build_result.stdout.find(" New ") == -1)
retries: 6
delay: 10
ignore_errors: yes
Expand Down

0 comments on commit 6d0c0d3

Please sign in to comment.