def configure_devel_job(<EOL>config_url, rosdistro_name, source_build_name,<EOL>repo_name, os_name, os_code_name, arch,<EOL>pull_request=False,<EOL>config=None, build_file=None,<EOL>index=None, dist_file=None, dist_cache=None,<EOL>jenkins=None, views=None,<EOL>is_disabled=False,<EOL>groovy_script=None,<EOL>source_repository=None,<EOL>build_targets=None,<EOL>dry_run=False):
if config is None:<EOL><INDENT>config = get_config_index(config_url)<EOL><DEDENT>if build_file is None:<EOL><INDENT>build_files = get_source_build_files(config, rosdistro_name)<EOL>build_file = build_files[source_build_name]<EOL><DEDENT>if build_targets is not None:<EOL><INDENT>build_file.targets = build_targets<EOL><DEDENT>if index is None:<EOL><INDENT>index = get_index(config.rosdistro_index_url)<EOL><DEDENT>if dist_file is None:<EOL><INDENT>dist_file = get_distribution_file(index, rosdistro_name, build_file)<EOL>if not dist_file:<EOL><INDENT>raise JobValidationError(<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>repo_names = dist_file.repositories.keys()<EOL>if repo_name is not None:<EOL><INDENT>if repo_name not in repo_names:<EOL><INDENT>raise JobValidationError(<EOL>"<STR_LIT>" % repo_name +<EOL>'<STR_LIT>' %<EOL>'<STR_LIT:U+002CU+0020>'.join(sorted(repo_names)))<EOL><DEDENT>repo = dist_file.repositories[repo_name]<EOL>if not repo.source_repository:<EOL><INDENT>raise JobValidationError(<EOL>"<STR_LIT>" % repo_name)<EOL><DEDENT>if not repo.source_repository.version:<EOL><INDENT>raise JobValidationError(<EOL>"<STR_LIT>" % repo_name)<EOL><DEDENT>source_repository = repo.source_repository<EOL><DEDENT>if os_name not in build_file.targets.keys():<EOL><INDENT>raise JobValidationError(<EOL>"<STR_LIT>" % os_name +<EOL>'<STR_LIT>' +<EOL>'<STR_LIT:U+002CU+0020>'.join(sorted(build_file.targets.keys())))<EOL><DEDENT>if os_code_name not in build_file.targets[os_name].keys():<EOL><INDENT>raise JobValidationError(<EOL>"<STR_LIT>" % os_code_name +<EOL>'<STR_LIT>' +<EOL>'<STR_LIT:U+002CU+0020>'.join(sorted(build_file.targets[os_name].keys())))<EOL><DEDENT>if arch not in build_file.targets[os_name][os_code_name]:<EOL><INDENT>raise JobValidationError(<EOL>"<STR_LIT>" % arch +<EOL>'<STR_LIT>' % '<STR_LIT:U+002CU+0020>'.join(sorted(<EOL>build_file.targets[os_name][os_code_name])))<EOL><DEDENT>if dist_cache is None and build_file.notify_maintainers:<EOL><INDENT>dist_cache = get_distribution_cache(index, rosdistro_name)<EOL><DEDENT>if jenkins is None:<EOL><INDENT>from ros_buildfarm.jenkins import connect<EOL>jenkins = connect(config.jenkins_url)<EOL><DEDENT>if views is None:<EOL><INDENT>view_name = get_devel_view_name(<EOL>rosdistro_name, source_build_name, pull_request=pull_request)<EOL>configure_devel_view(jenkins, view_name, dry_run=dry_run)<EOL><DEDENT>job_name = get_devel_job_name(<EOL>rosdistro_name, source_build_name,<EOL>repo_name, os_name, os_code_name, arch, pull_request)<EOL>job_config = _get_devel_job_config(<EOL>index, config, rosdistro_name, source_build_name,<EOL>build_file, os_name, os_code_name, arch, source_repository,<EOL>repo_name, pull_request, job_name, dist_cache=dist_cache,<EOL>is_disabled=is_disabled)<EOL>if isinstance(jenkins, object) and jenkins is not False:<EOL><INDENT>from ros_buildfarm.jenkins import configure_job<EOL>configure_job(jenkins, job_name, job_config, dry_run=dry_run)<EOL><DEDENT>return job_name, job_config<EOL>
Configure a single Jenkins devel job.

This includes the following steps:
- clone the source repository to use
- clone the ros_buildfarm repository
- write the distribution repository keys into files
- invoke the release/run_devel_job.py script