diff --git a/playbooks/infra-prod/setup-src.yaml b/playbooks/infra-prod/setup-src.yaml index 557aa39..1738140 100644 --- a/playbooks/infra-prod/setup-src.yaml +++ b/playbooks/infra-prod/setup-src.yaml @@ -24,16 +24,30 @@ include_role: name: prepare-workspace-git - # When running from periodic/hourly we want to explicitly override - # to run from the tip of master + # The intent of the periodic jobs is to run with latest master. If + # they get enqueued, then other patches land, they'll still run + # with the value of the zuul ref from when they were + # enqueued. That's not what we want for prod, as it can lead to + # running or deploying old versions of config files. Reset them + # to master. - name: Should we run from master set_fact: infra_prod_run_from_master: "{{ zuul.pipeline|default('') in ['periodic', 'opendev-prod-hourly'] }}" - - name: Update from master + - name: Reset checkouts to master for periodic jobs when: infra_prod_run_from_master|bool - git: - repo: https://opendev.org/opendev/system-config - dest: /home/zuul/src/opendev.org/opendev/system-config - force: yes - version: master + block: + - name: Update system-config from master + git: + repo: 'https://opendev.org/opendev/system-config' + dest: '/home/zuul/src/opendev.org/opendev/system-config' + force: yes + version: 'master' + + - name: Update project-config from master + when: '"opendev.org/openstack/project-config" in zuul.projects' + git: + repo: 'https://opendev.org/openstack/project-config' + dest: '/home/zuul/src/opendev.org/openstack/project-config' + force: yes + version: 'master'