11 Commits

Author SHA1 Message Date
Ian Wienand
9b17d6c9df collect-container-logs: don't copy on failure
After a docker failure on a recent job I noticed a single file called
"Got" in the container logs directory; turns out this had tried to
parse the error message "Got permission denied while trying to connect
to the Docker daemon socket ..." as containers.

We don't want this to fail the job hence the ignores here.  However,
we shouldn't try to collect any logs if listing the containers fails.
Move creating the directory first as that is safe.

Change-Id: I41db956964f695cfcc15e30cab8cd4f8c31d3706
2021-04-20 12:10:02 +10:00
Sorin Sbarnea
6b8cc6d468 More E208 (final)
Change-Id: I705d1b10696326f3d4d5bef4b5a88a83f2c3d960
2020-11-10 19:34:45 +00:00
Sorin Sbarnea
9baebe3684 yamlint: EOF newlines and comments indent
Fixed two rules which where temporary disabled during introduction
of the linter.

Change-Id: Icd1e1b40b1e8207ab5ff7088a48e8f0a800e3aa8
2020-05-14 08:42:17 +00:00
Albin Vass
a5f5091897 Revert "Revert "Do not set buildset_fact if it's not present in results.json""
This reverts commit b5e87e62f1ff03dd80067aa1ec297007770301ce.

Change-Id: I839c0fb9811ce68e2949402f12aab1387d1a812e
2020-04-28 21:26:16 +02:00
Zuul
fa48a66db3 Merge "Revert "Do not set buildset_fact if it's not present in results.json"" 2020-04-28 19:09:29 +00:00
Albin Vass
b5e87e62f1 Revert "Do not set buildset_fact if it's not present in results.json"
This reverts commit bc0ca442a11fee5c610a71b50d8d0073d5293d2b.

Change-Id: If0885877a1c976ed430d6e3a7a462e06042874fb
2020-04-28 18:35:10 +00:00
Albin Vass
a7da59703f container-logs: use failed_when: instead of ignore_errors:
Change-Id: I3b59c126b8d1dff38eef40003e3c63846dec959a
2020-04-27 20:53:45 +02:00
Albin Vass
bc0ca442a1 Do not set buildset_fact if it's not present in results.json
Change-Id: I9a8790e6f3628924f796b4f3eff052b5e36eff03
2020-04-27 19:53:47 +02:00
Clark Boylan
4ed66807a0 Use unique loop vars to avoid conflicts
We have to be careful about avoiding outer loop loop_var conflicts in
ansible. Because the zuul-jobs roles are meant to be reconsumed
elsewhere we should not use 'item' loopvars and instead set them to
something a bit more unique.

We use a zj_ prefix to try and be unique to this repo and document this
convention.

Change-Id: I20b9327a914890e9eafcb2b36dc8c23fb472bc8f
2020-02-04 12:23:36 -08:00
Clark Boylan
e323dc117b Don't use item in collect container logs loop
The default loop variable 'item' cannot be nested. Because roles like
collect-container-logs may be called from higher level loops that use
'item' we override the loop control var to a name that should be unique.

This should probably be done to all of the other roles in zuul-jobs too.

Change-Id: I2f647596dd40c662aa7447e3d3c8844a77c6b109
2020-02-01 14:24:16 -08:00
Mohammed Naser
228033e78a collect-container-logs: add role
We use this in a few different places and it's really useful
to collect all the logs of all containers.

Change-Id: Idc46a47f444bf48cd040f4f9724f3a6ee8bc8f8e
2020-01-09 19:52:01 -05:00