From 72d7401b8c2f9b1bb46be1650d9d728ea500ba46 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 17 Nov 2021 15:02:18 +1100 Subject: [PATCH] infra-prod: override checkout on periodic/hourly This override is already done in system-config, but it makes more sense to do it here in the generic job. Change-Id: If47d2068b02cc868b03dfe7ceb254c7d1ecf9d9b --- playbooks/infra-prod/pre.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/playbooks/infra-prod/pre.yaml b/playbooks/infra-prod/pre.yaml index 9fffef1..01a85b1 100644 --- a/playbooks/infra-prod/pre.yaml +++ b/playbooks/infra-prod/pre.yaml @@ -43,3 +43,17 @@ - name: Synchronize src repos to workspace directory. include_role: name: prepare-workspace-git + + # When running from periodic/hourly we want to explicitly override + # to run from the tip of 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 + 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