Separately set publish_site for docs promotion

Formatting a variable with a singular undefined parameter triggers
an error, so instead add a separate task to set publish_site as a
fact first, if it's been passed, and then just consume that in the
subsequent task.

This also basically reverts 2c96eae80d
as that solution introduced the regression we're fixing.

Change-Id: I335bafab0d926a0f75971cdd0954a34911ae29c1
This commit is contained in:
Jeremy Stanley 2021-06-30 18:48:29 +00:00
parent 2c96eae80d
commit cbad63e3b2
1 changed files with 5 additions and 1 deletions

View File

@ -52,9 +52,13 @@
when: "zuul.branch != 'master'"
set_fact:
target_dict: "{{ afs.targets.branch }}"
- name: Set publish site
set_fact:
publish_site: "{{ publish_site.format(zuul=zuul) }}"
when: publish_site is defined
- name: Set target path
set_fact:
target_dir: "{{ target_dict.path.format(zuul=zuul, publish_site=publish_site.format(zuul=zuul), special_publish_directory=special_publish_directory) }}"
target_dir: "{{ target_dict.path.format(zuul=zuul, publish_site=publish_site, special_publish_directory=special_publish_directory) }}"
- name: Adjust target path
when: "target_dict.regex is defined"
set_fact: