Merge branch 'master' into slowroll

This commit is contained in:
Witek Bedyk 2024-08-02 10:19:22 +02:00 committed by GitHub
commit 7b82461edb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 44 additions and 16 deletions

View File

@ -1,6 +1,6 @@
format_version: 3
pipelines:
SLE15.SP7.Images:
SLE15.SP7.Images.To.Test:
group: SLE15.Target
lock_behavior: unlockWhenFinished
materials:
@ -29,7 +29,7 @@ pipelines:
./scripts/gocd/verify-repo-built-successful.py -A https://api.suse.de -p SUSE:SLE-15-SP7:GA -r containerfile
./scripts/gocd/verify-repo-built-successful.py -A https://api.suse.de -p SUSE:SLE-15-SP7:GA -r images
- Release.Images.To.Test:
- Release.Images:
approval: manual
roles:
- SLE
@ -64,7 +64,25 @@ pipelines:
done
osc -A https://api.suse.de/ api "/build/SUSE:SLE-15-SP7:GA:TEST/_result?view=summary&repository=images" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED
- Release.Images.To.Publish:
SLE15.SP7.Images.To.Publish:
group: SLE15.Target
materials:
repos:
git: git://botmaster.suse.de/suse-repos.git
auto_update: true
whitelist:
- SUSE:SLE-15-SP7:GA_-_images.yaml
destination: repos
scripts:
auto_update: true
git: https://github.com/openSUSE/openSUSE-release-tools.git
whitelist:
- DO_NOT_TRIGGER
destination: scripts
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- Release.Images:
approval: manual
roles:
- SLE

View File

@ -154,6 +154,12 @@ class FreezeCommand(object):
for lprj in links:
ET.SubElement(root, 'link', {'project': lprj})
# 'images' and 'product' repositories are closely related,
# and they need to be handled the same way.
image_repositories = ['images']
if self.api.project_has_repo('product', self.prj):
image_repositories.append('product')
# build flag
f = ET.SubElement(root, 'build')
# this one is the global toggle
@ -161,12 +167,14 @@ class FreezeCommand(object):
# this one stays
ET.SubElement(f, 'disable', {'repository': 'bootstrap_copy'})
# to be flipped by botmaster
ET.SubElement(f, 'disable', {'repository': 'images'})
for repository in image_repositories:
ET.SubElement(f, 'disable', {'repository': repository})
# publish flag
f = ET.SubElement(root, 'publish')
ET.SubElement(f, 'disable')
ET.SubElement(f, 'enable', {'repository': 'images'})
for repository in image_repositories:
ET.SubElement(f, 'enable', {'repository': repository})
# debuginfo flag
f = ET.SubElement(root, 'debuginfo')
@ -184,12 +192,14 @@ class FreezeCommand(object):
a = ET.SubElement(r, 'arch')
a.text = arch
r = ET.SubElement(root, 'repository', {'name': 'images', 'linkedbuild': 'all'})
for repository in image_repositories:
r = ET.SubElement(root, 'repository', {'name': repository, 'linkedbuild': 'all'})
ET.SubElement(r, 'path', {'project': self.prj, 'repository': 'standard'})
if self.prj.startswith('SUSE:'):
a = ET.SubElement(r, 'arch')
a.text = 'local'
a = ET.SubElement(r, 'arch')
a.text = 'x86_64'

View File

@ -144,9 +144,9 @@ class StagingAPI(object):
self._is_staging_manager = self.is_user_member_of(self.user, self.cstaging_group)
return self._is_staging_manager
def project_has_repo(self, repo_name):
def project_has_repo(self, repo_name, project=None):
# Determine if the project has a repo with given name
meta = self.get_prj_meta(self.project)
meta = self.get_prj_meta(project or self.project)
xpath = f'repository[@name="{repo_name}"]'
return len(meta.xpath(xpath)) > 0