zuul-jobs/test-playbooks/registry/buildset-registry-openshift-docker.yaml
Ian Wienand 977aaf6f59
ansible-lint: use pipefail
Use pipefail in some shell commands.  In this case I don't think we
can really be fooled, but not a bad idea to fail if the first command
errors.

Change-Id: I25750c4edfe815af9e9d9ee47639b315e7133aa2
2023-02-03 15:36:25 +11:00

36 lines
1.2 KiB
YAML

- hosts: all
roles:
- role: clear-firewall
- role: ensure-openshift
- role: use-buildset-registry
buildset_registry_docker_user: root
- role: deploy-openshift
tasks:
- name: Wait for cluster to come up
command: kubectl cluster-info
register: result
until: result.rc == 0
retries: 5
delay: 30
- name: Run a local test pod
command: oc run --generator=run-pod/v1 --image=zuul/docker-testimage dockertest
- name: Wait for the pod to be ready
command: oc wait --for=condition=Ready pod/dockertest --timeout=60s
- name: Check the output of the pod
shell: |
set -o pipefail
oc logs pod/dockertest | grep 'Zuul container test'
args:
executable: /bin/bash
- name: Run a remote test pod
command: oc run --generator=run-pod/v1 --image=debian:testing upstream-dockertest --command -- /bin/bash -c 'echo Upstream; sleep infinity'
- name: Wait for the pod to be ready
command: oc wait --for=condition=Ready pod/upstream-dockertest --timeout=60s
- name: Check the output of the pod
shell: |
set -o pipefail
oc logs pod/upstream-dockertest | grep 'Upstream'
args:
executable: /bin/bash