def get_upstream_job_names(config, repo): distributions = config.distributions.keys() if repo == 'main': upstream_job_names = ['{0}_sync-packages-to-{1}'.format( get_release_job_prefix(rosdistro), repo) for rosdistro in distributions] elif repo == 'testing': upstream_job_names = [] for rosdistro in distributions: architectures_by_code_name = {} build_files = get_release_build_files(config, rosdistro) for build_file in build_files.values(): for os_name in build_file.targets.keys(): for code_name, architectures in build_file.targets[os_name].items(): architectures_by_code_name[code_name] = \ architectures_by_code_name.get(code_name, set()) | \ set(architectures.keys()) for code_name, archs in architectures_by_code_name.items(): for arch in archs: upstream_job_names.append( '{prefix}_sync-packages-to-{repo}_{code_name}_{arch}'.format( prefix=get_release_job_prefix(rosdistro), repo=repo, code_name=code_name, arch=arch)) else: raise JobValidationError("Unknown upstream jobs for job 'upload_{}'." % repo) return ','.join(sorted(upstream_job_names))
def get_upstream_job_names(config, repo): distributions = config.distributions.keys() if repo == 'main': upstream_job_names = [ '{0}_sync-packages-to-{1}'.format( get_release_job_prefix(rosdistro), repo) for rosdistro in distributions ] elif repo == 'testing': upstream_job_names = [] for rosdistro in distributions: architectures_by_code_name = {} build_files = get_release_build_files(config, rosdistro) for build_file in build_files.values(): for os_name in build_file.targets.keys(): for code_name, architectures in build_file.targets[ os_name].items(): architectures_by_code_name[code_name] = \ architectures_by_code_name.get(code_name, set()) | \ set(architectures.keys()) for code_name, archs in architectures_by_code_name.items(): for arch in archs: upstream_job_names.append( '{prefix}_sync-packages-to-{repo}_{code_name}_{arch}'. format(prefix=get_release_job_prefix(rosdistro), repo=repo, code_name=code_name, arch=arch)) else: raise JobValidationError("Unknown upstream jobs for job 'upload_{}'." % repo) upstream_job_names.append('import_upstream') return ','.join(sorted(upstream_job_names))
def get_job_config(args, config): template_name = 'misc/rosdistro_cache_job.xml.em' repository_args, script_generating_key_files = \ get_repositories_and_script_generating_key_files(config=config) reconfigure_job_names = [] build_files = get_release_build_files(config, args.rosdistro_name) for release_build_name in sorted(build_files.keys()): group_name = get_release_job_prefix( args.rosdistro_name, release_build_name) job_name = '%s_%s' % (group_name, 'reconfigure-jobs') reconfigure_job_names.append(job_name) job_data = copy.deepcopy(args.__dict__) job_data.update({ 'ros_buildfarm_repository': get_repository(), 'script_generating_key_files': script_generating_key_files, 'rosdistro_index_url': config.rosdistro_index_url, 'repository_args': repository_args, 'reconfigure_job_names': reconfigure_job_names, 'notification_emails': config.distributions[args.rosdistro_name]['notification_emails'], 'git_ssh_credential_id': config.git_ssh_credential_id, }) job_config = expand_template(template_name, job_data) return job_config
def main(argv=sys.argv[1:]): parser = argparse.ArgumentParser( description="Generate the 'release' management jobs on Jenkins") add_argument_config_url(parser) add_argument_rosdistro_name(parser) add_argument_build_name(parser, 'release') add_argument_dry_run(parser) args = parser.parse_args(argv) config = get_index(args.config_url) build_files = get_release_build_files(config, args.rosdistro_name) build_file = build_files[args.release_build_name] package_formats = set( package_format_mapping[os_name] for os_name in build_file.targets.keys()) assert len(package_formats) == 1 package_format = package_formats.pop() group_name = get_release_job_prefix( args.rosdistro_name, args.release_build_name) reconfigure_jobs_job_config = get_reconfigure_jobs_job_config( args, config, build_file) trigger_jobs_job_config = get_trigger_jobs_job_config( args, config, build_file) trigger_missed_jobs_job_config = get_trigger_missed_jobs_job_config( args, config, build_file) import_upstream_job_config = get_import_upstream_job_config( args, config, build_file, package_format) trigger_broken_with_non_broken_upstream_job_config = \ _get_trigger_broken_with_non_broken_upstream_job_config( args.rosdistro_name, args.release_build_name, build_file) jenkins = connect(config.jenkins_url) configure_management_view(jenkins, dry_run=args.dry_run) job_name = '%s_%s' % (group_name, 'reconfigure-jobs') configure_job( jenkins, job_name, reconfigure_jobs_job_config, dry_run=args.dry_run) job_name = '%s_%s' % (group_name, 'trigger-jobs') configure_job( jenkins, job_name, trigger_jobs_job_config, dry_run=args.dry_run) job_name = '%s_%s' % (group_name, 'trigger-missed-jobs') configure_job( jenkins, job_name, trigger_missed_jobs_job_config, dry_run=args.dry_run) job_name = 'import_upstream%s' % ('' if package_format == 'deb' else '_' + package_format) configure_job( jenkins, job_name, import_upstream_job_config, dry_run=args.dry_run) job_name = '%s_%s' % \ (group_name, 'trigger-broken-with-non-broken-upstream') configure_job( jenkins, job_name, trigger_broken_with_non_broken_upstream_job_config, dry_run=args.dry_run)
def main(argv=sys.argv[1:]): parser = argparse.ArgumentParser( description="Generate the 'release' management jobs on Jenkins") add_argument_config_url(parser) add_argument_rosdistro_name(parser) add_argument_build_name(parser, 'release') add_argument_dry_run(parser) args = parser.parse_args(argv) config = get_index(args.config_url) build_files = get_release_build_files(config, args.rosdistro_name) build_file = build_files[args.release_build_name] group_name = get_release_job_prefix( args.rosdistro_name, args.release_build_name) reconfigure_jobs_job_config = get_reconfigure_jobs_job_config( args, config, build_file) trigger_jobs_job_config = get_trigger_jobs_job_config( args, config, build_file) trigger_missed_jobs_job_config = get_trigger_missed_jobs_job_config( args, config, build_file) import_upstream_job_config = get_import_upstream_job_config( args, config, build_file) trigger_broken_with_non_broken_upstream_job_config = \ _get_trigger_broken_with_non_broken_upstream_job_config( args.rosdistro_name, args.release_build_name, build_file) jenkins = connect(config.jenkins_url) configure_management_view(jenkins, dry_run=args.dry_run) job_name = '%s_%s' % (group_name, 'reconfigure-jobs') configure_job( jenkins, job_name, reconfigure_jobs_job_config, dry_run=args.dry_run) job_name = '%s_%s' % (group_name, 'trigger-jobs') configure_job( jenkins, job_name, trigger_jobs_job_config, dry_run=args.dry_run) job_name = '%s_%s' % (group_name, 'trigger-missed-jobs') configure_job( jenkins, job_name, trigger_missed_jobs_job_config, dry_run=args.dry_run) job_name = 'import_upstream' configure_job( jenkins, job_name, import_upstream_job_config, dry_run=args.dry_run) job_name = '%s_%s' % \ (group_name, 'trigger-broken-with-non-broken-upstream') configure_job( jenkins, job_name, trigger_broken_with_non_broken_upstream_job_config, dry_run=args.dry_run)
def get_job_config(args, config): template_name = 'misc/rosdistro_cache_job.xml.em' repository_args, script_generating_key_files = \ get_repositories_and_script_generating_key_files(config=config) reconfigure_job_names = [] build_files = get_release_build_files(config, args.rosdistro_name) for release_build_name in sorted(build_files.keys()): group_name = get_release_job_prefix(args.rosdistro_name, release_build_name) job_name = '%s_%s' % (group_name, 'reconfigure-jobs') reconfigure_job_names.append(job_name) reconfigure_doc_job_names = [] build_files = get_doc_build_files(config, args.rosdistro_name) for doc_build_name in sorted(build_files.keys()): group_name = get_doc_view_name(args.rosdistro_name, doc_build_name) job_name = '%s_%s' % (group_name, 'reconfigure-jobs') reconfigure_doc_job_names.append(job_name) reconfigure_source_job_names = [] build_files = get_source_build_files(config, args.rosdistro_name) for source_build_name in sorted(build_files.keys()): group_name = get_devel_view_name(args.rosdistro_name, source_build_name) job_name = '%s_%s' % (group_name, 'reconfigure-jobs') reconfigure_source_job_names.append(job_name) job_data = copy.deepcopy(args.__dict__) job_data.update({ 'ros_buildfarm_repository': get_repository(), 'script_generating_key_files': script_generating_key_files, 'rosdistro_index_url': config.rosdistro_index_url, 'repository_args': repository_args, 'reconfigure_job_names': reconfigure_job_names, 'reconfigure_doc_job_names': reconfigure_doc_job_names, 'reconfigure_source_job_names': reconfigure_source_job_names, 'notification_emails': config.distributions[args.rosdistro_name]['notification_emails'], 'git_ssh_credential_id': config.git_ssh_credential_id, }) job_config = expand_template(template_name, job_data) return job_config
def main(argv=sys.argv[1:]): parser = argparse.ArgumentParser( description="Generate the 'repos_status_page' job on Jenkins") add_argument_config_url(parser) add_argument_rosdistro_name(parser) args = parser.parse_args(argv) config = get_index(args.config_url) job_config = get_job_config(args, config) jenkins = connect(config.jenkins_url) configure_management_view(jenkins) prefix = get_release_job_prefix(args.rosdistro_name) job_name = '%s_repos-status-page' % prefix configure_job(jenkins, job_name, job_config)
def main(argv=sys.argv[1:]): parser = argparse.ArgumentParser( description="Generate the 'blocked_source_entries_page' job on Jenkins" ) add_argument_config_url(parser) add_argument_rosdistro_name(parser) add_argument_dry_run(parser) args = parser.parse_args(argv) config = get_index(args.config_url) job_config = get_job_config(args, config) jenkins = connect(config.jenkins_url) configure_management_view(jenkins, dry_run=args.dry_run) prefix = get_release_job_prefix(args.rosdistro_name) job_name = '%s_blocked-source-entries-page' % prefix configure_job(jenkins, job_name, job_config, dry_run=args.dry_run)
def main(argv=sys.argv[1:]): parser = argparse.ArgumentParser( description="Generate the 'release' management jobs on Jenkins") add_argument_config_url(parser) add_argument_rosdistro_name(parser) add_argument_build_name(parser, 'release') args = parser.parse_args(argv) config = get_index(args.config_url) build_files = get_release_build_files(config, args.rosdistro_name) build_file = build_files[args.release_build_name] group_name = get_release_job_prefix(args.rosdistro_name, args.release_build_name) reconfigure_jobs_job_config = get_reconfigure_jobs_job_config( args, config, build_file) trigger_jobs_job_config = get_trigger_jobs_job_config( args, config, build_file) import_upstream_job_config = get_import_upstream_job_config( args, config, build_file) trigger_broken_with_non_broken_upstream_job_config = \ _get_trigger_broken_with_non_broken_upstream_job_config( args.rosdistro_name, args.release_build_name, build_file) jenkins = connect(config.jenkins_url) configure_management_view(jenkins) job_name = '%s_%s' % (group_name, 'reconfigure-jobs') configure_job(jenkins, job_name, reconfigure_jobs_job_config) job_name = '%s_%s' % (group_name, 'trigger-jobs') configure_job(jenkins, job_name, trigger_jobs_job_config) job_name = 'import_upstream' configure_job(jenkins, job_name, import_upstream_job_config) job_name = '%s_%s' % \ (group_name, 'trigger-broken-with-non-broken-upstream') configure_job(jenkins, job_name, trigger_broken_with_non_broken_upstream_job_config)
def get_sync_packages_to_main_job_name(rosdistro_name): view_name = get_release_job_prefix(rosdistro_name) return '%s_sync-packages-to-main' % view_name
def get_sync_packages_to_testing_job_name( rosdistro_name, os_code_name, arch): view_name = get_release_job_prefix(rosdistro_name) return '%s_sync-packages-to-testing_%s_%s' % \ (view_name, os_code_name, arch)
def get_import_package_job_name(rosdistro_name): view_name = get_release_job_prefix(rosdistro_name) return '%s_import-package' % view_name
def get_sync_packages_to_testing_job_name(rosdistro_name, os_name, os_code_name, arch): view_name = get_release_job_prefix(rosdistro_name) return '%s_sync-packages-to-testing%s_%s_%s' % ( view_name, '' if package_format_mapping[os_name] == 'deb' else '_' + os_name, os_code_name, arch)
def get_sync_packages_to_testing_job_name(rosdistro_name, os_code_name, arch): view_name = get_release_job_prefix(rosdistro_name) return '%s_sync-packages-to-testing_%s_%s' % \ (view_name, os_code_name, arch)
def get_sync_packages_to_main_job_name(rosdistro_name, package_format): view_name = get_release_job_prefix(rosdistro_name) return '%s_sync-packages-to-main%s' % (view_name, '' if package_format == 'deb' else '-' + package_format)
def get_import_package_job_name(rosdistro_name, package_format): view_name = get_release_job_prefix(rosdistro_name) return '%s_import-package%s' % (view_name, '' if package_format == 'deb' else '-' + package_format)