From 552ce11f0285890c19ed561daa96befcbc1a0e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Fri, 12 Jan 2024 08:50:09 +0100 Subject: [PATCH] Add staging project refresh job to obs workflows We were facing an odd issue in the :CR project, the project wide scmsync was not being updated at all and hence the project contained no packages. This can be solved by triggering a servicerun for the _project "package", which will refresh the scmsync. --- src/staging/bot.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/staging/bot.py b/src/staging/bot.py index f8f59ef0d..26950cb05 100644 --- a/src/staging/bot.py +++ b/src/staging/bot.py @@ -342,6 +342,13 @@ def obs_workflows_yml(self) -> str: sub-project. """ + deployment_branch_push_filter = f""" filters: + event: push + branches: + only: + - {self.deployment_branch_name} +""" + workflows = """--- staging_build: steps: @@ -353,9 +360,16 @@ def obs_workflows_yml(self) -> str: source_package: {bci.package_name} target_project: {source_project}:Staging """ - workflows += """ filters: + workflows += f""" filters: event: pull_request +refresh_staging_project: + steps: + - trigger_services: + project: {source_project} + package: _project +{deployment_branch_push_filter} + refresh_devel_BCI: steps: """ @@ -366,12 +380,8 @@ def obs_workflows_yml(self) -> str: package: {bci.package_name} """ - workflows += f""" filters: - event: push - branches: - only: - - {self.deployment_branch_name} -""" + workflows += deployment_branch_push_filter + return workflows @property