
Now that we use the buildset-registry job in all docker builds (whether they run the registry internally or not), in the post playbook we need to check whether the registry was actually started in the pre playbook before we attempt to save its logs. Change-Id: Ifa925faf7bfdc83238677261726aa96461faddb0
25 lines
686 B
YAML
25 lines
686 B
YAML
- hosts: localhost
|
|
roles:
|
|
- push-to-intermediate-registry
|
|
|
|
- hosts: all
|
|
tasks:
|
|
- name: Check if buildset registry is running
|
|
command: "docker ps"
|
|
register: docker_ps
|
|
|
|
- name: Create container log dir
|
|
when: "'buildset_registry' in docker_ps.stdout"
|
|
file:
|
|
path: "{{ ansible_user_dir }}/zuul-output/logs/docker"
|
|
state: directory
|
|
|
|
- name: Save registry container logs
|
|
when: "'buildset_registry' in docker_ps.stdout"
|
|
loop:
|
|
- buildset_proxy
|
|
- buildset_registry
|
|
shell: "docker logs {{ item }} &> {{ ansible_user_dir }}/zuul-output/logs/docker/{{item}}.txt"
|
|
args:
|
|
executable: /bin/bash
|