openqa/server: handle FIF format template loading
We just invented a new format for openQA templates. This makes the openqa/server role handle loading templates in either format. I'll remove old-format loading when we're done tweaking the new setup and it's deployed to prod. Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
parent
180b084491
commit
bc681d703d
1 changed files with 16 additions and 6 deletions
|
@ -279,6 +279,11 @@
|
|||
changed_when: "admin.rc == 0"
|
||||
failed_when: "(admin.rc > 0) and (admin.stderr is not defined or admin.stderr.find('already exists') == -1)"
|
||||
|
||||
- name: Check if we're on upstream template format or FIF
|
||||
stat:
|
||||
path: /var/lib/openqa/share/tests/fedora/templates.fif.json
|
||||
register: templatesfif
|
||||
|
||||
- name: Dump existing config for checking changes
|
||||
shell: "/usr/share/openqa/script/dump_templates --json > /tmp/tmpl-old.json"
|
||||
when: "(gittests is defined) and (gittests is changed)"
|
||||
|
@ -286,16 +291,21 @@
|
|||
|
||||
# Because of the boring details of how template loading works, getting
|
||||
# a correct 'changed' for this step is too difficult. Instead we have
|
||||
# the prior and following steps; when the templates actually changed,
|
||||
# the *following* step will register as changed.
|
||||
- name: Load main tests
|
||||
# the dump (above) and check (later) steps; when the templates actually
|
||||
# changed, the *check* step will register as changed.
|
||||
- name: Load main tests (upstream format)
|
||||
command: "/var/lib/openqa/share/tests/fedora/templates --clean"
|
||||
when: "(gittests is defined) and (gittests is changed)"
|
||||
when: "(gittests is defined) and (gittests is changed) and (templatesfif.stat.exists == false)"
|
||||
changed_when: "1 != 1"
|
||||
|
||||
- name: Load update tests
|
||||
- name: Load update tests (upstream format)
|
||||
command: "/var/lib/openqa/share/tests/fedora/templates-updates --update"
|
||||
when: "(gittests is defined) and (gittests is changed)"
|
||||
when: "(gittests is defined) and (gittests is changed) and (templatesfif.stat.exists == false)"
|
||||
changed_when: "1 != 1"
|
||||
|
||||
- name: Load all tests (FIF format)
|
||||
command: "/var/lib/openqa/share/tests/fedora/fifloader -l --clean templates.fif.json templates-updates.fif.json"
|
||||
when: "(gittests is defined) and (gittests is changed) and (templatesfif.stat.exists == true)"
|
||||
changed_when: "1 != 1"
|
||||
|
||||
- name: Check if the tests changed in previous step
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue