Revert "Revert "Do not set buildset_fact if it's not present in results.json""

This reverts commit b5e87e62f1.

Change-Id: I839c0fb9811ce68e2949402f12aab1387d1a812e
This commit is contained in:
Albin Vass 2020-04-28 20:55:30 +02:00
parent fa48a66db3
commit a5f5091897
3 changed files with 23 additions and 5 deletions

View File

@ -1,9 +1,18 @@
- name: Check for results.json
stat:
path: "{{ zuul.executor.work_root }}/results.json"
register: result_json_stat
delegate_to: localhost
# This can be removed if we add this functionality to Zuul directly
- name: Load information from zuul_return
when: buildset_registry is not defined
set_fact:
buildset_registry: "{{ (lookup('file', zuul.executor.work_root + '/results.json') | from_json)['buildset_registry'] }}"
ignore_errors: true
when:
- buildset_registry is not defined
- result_json_stat.stat.exists
- result_json_stat.stat.size > 0
- "'buildset_registry' in (lookup('file', zuul.executor.work_root + '/results.json') | from_json)"
- name: Set container filename arg
set_fact:

View File

@ -1,9 +1,18 @@
- name: Check for results.json
stat:
path: "{{ zuul.executor.work_root }}/results.json"
register: result_json_stat
delegate_to: localhost
# This can be removed if we add this functionality to Zuul directly
- name: Load information from zuul_return
when: buildset_registry is not defined
set_fact:
buildset_registry: "{{ (lookup('file', zuul.executor.work_root + '/results.json') | from_json)['buildset_registry'] }}"
ignore_errors: true
when:
- buildset_registry is not defined
- result_json_stat.stat.exists
- result_json_stat.stat.size > 0
- "'buildset_registry' in (lookup('file', zuul.executor.work_root + '/results.json') | from_json)"
- name: Build docker images
include_tasks: build.yaml

View File

@ -1,7 +1,7 @@
- name: List containers
command: "{{ container_command }} ps -a --format '{{ '{{ .Names }}' }}'"
register: docker_containers
ignore_errors: true
failed_when: false
- name: Create container log dir
file: