Skip to content

Commit

Permalink
Add RPM jobs as upstream of upload jobs (#1052)
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay authored May 25, 2024
1 parent 1f289d7 commit 3400101
Showing 1 changed file with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from ros_buildfarm.argument import add_argument_dry_run
from ros_buildfarm.common import get_release_job_prefix
from ros_buildfarm.common import JobValidationError
from ros_buildfarm.common import package_format_mapping
from ros_buildfarm.config import get_index
from ros_buildfarm.config import get_release_build_files
from ros_buildfarm.jenkins import configure_job
Expand Down Expand Up @@ -68,11 +69,23 @@ def get_sync_targets(config, repo):

def get_upstream_job_names(config, repo):
distributions = config.distributions.keys()
package_formats_per_rosdistro = {}
for rosdistro in distributions:
package_formats_per_rosdistro.setdefault(rosdistro, set())
build_files = get_release_build_files(config, rosdistro)
for build_file in build_files.values():
for os_name in build_file.targets.keys():
package_formats_per_rosdistro[rosdistro].add(
package_format_mapping[os_name])
upstream_job_names = []
if repo == 'main':
upstream_job_names = ['{0}_sync-packages-to-{1}'.format(
get_release_job_prefix(rosdistro), repo) for rosdistro in distributions]
for rosdistro, package_formats in package_formats_per_rosdistro.items():
for package_format in package_formats:
upstream_job_names.append(
'{0}_sync-packages-to-{1}{2}'.format(
get_release_job_prefix(rosdistro), repo,
'' if package_format == 'deb' else '-' + package_format))
elif repo == 'testing':
upstream_job_names = []
for rosdistro in distributions:
architectures_by_code_name = {}
build_files = get_release_build_files(config, rosdistro)
Expand All @@ -93,7 +106,13 @@ def get_upstream_job_names(config, repo):
arch=arch))
else:
raise JobValidationError("Unknown upstream jobs for job 'upload_{}'." % repo)
upstream_job_names.append('import_upstream')
for package_format in set(
pf for pfs in package_formats_per_rosdistro.values() for pf in pfs
):
if package_format == 'deb':
upstream_job_names.append('import_upstream')
else:
upstream_job_names.append('import_upstream_' + package_format)
return ','.join(sorted(upstream_job_names))


Expand Down

0 comments on commit 3400101

Please sign in to comment.