Skip to content

Commit

Permalink
Merge pull request #845 from SUSE/trigger-project-wide-scmsync
Browse files Browse the repository at this point in the history
Add staging project refresh job to obs workflows
  • Loading branch information
dcermak authored Jan 12, 2024
2 parents b3cfd1a + 552ce11 commit a05e03c
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/staging/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
"""
Expand All @@ -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
Expand Down

0 comments on commit a05e03c

Please sign in to comment.