diff --git a/ros_buildfarm/scripts/release/generate_release_trigger_upload_jobs.py b/ros_buildfarm/scripts/release/generate_release_trigger_upload_jobs.py index e03a23480..99073d50e 100644 --- a/ros_buildfarm/scripts/release/generate_release_trigger_upload_jobs.py +++ b/ros_buildfarm/scripts/release/generate_release_trigger_upload_jobs.py @@ -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 @@ -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) @@ -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))