示例#1
0
def _get_job_config(args,
                    config,
                    recipients,
                    template_name,
                    additional_data=None):
    repository_args, script_generating_key_files = \
        get_repositories_and_script_generating_key_files(config=config)

    job_data = dict(additional_data) if additional_data is not None else {}
    job_data.update({
        'script_generating_key_files':
        script_generating_key_files,
        'config_url':
        args.config_url,
        'rosdistro_name':
        args.rosdistro_name,
        'release_build_name':
        args.release_build_name,
        'repository_args':
        repository_args,
        'ros_buildfarm_repository':
        get_repository(),
        'credentials_src':
        os.path.join('~', os.path.dirname(get_relative_credential_path())),
        'credentials_dst':
        os.path.join('/home/buildfarm',
                     os.path.dirname(get_relative_credential_path())),
        'recipients':
        recipients,
    })
    job_config = expand_template(template_name, job_data)
    return job_config
示例#2
0
def get_reconfigure_jobs_job_config(args, config, build_file):
    template_name = 'doc/doc_reconfigure-jobs_job.xml.em'

    repository_args, script_generating_key_files = \
        get_repositories_and_script_generating_key_files(config=config)

    job_data = {
        'script_generating_key_files':
        script_generating_key_files,
        'config_url':
        args.config_url,
        'rosdistro_name':
        args.rosdistro_name,
        'doc_build_name':
        args.doc_build_name,
        'repository_args':
        repository_args,
        'ros_buildfarm_repository':
        get_repository(),
        'credentials_src':
        os.path.join('~', os.path.dirname(get_relative_credential_path())),
        'credentials_dst':
        os.path.join('/home/buildfarm',
                     os.path.dirname(get_relative_credential_path())),
        'recipients':
        build_file.notify_emails,
    }
    job_config = expand_template(template_name, job_data)
    return job_config
def _get_job_config(args, config, build_file, template_name):
    now = datetime.utcnow()
    now_str = now.strftime('%Y-%m-%dT%H:%M:%SZ')

    apt_mirror_args, script_generating_key_files = \
        get_repositories_and_script_generating_key_files(config, build_file)

    job_data = {
        'template_name': template_name,
        'now_str': now_str,

        'script_generating_key_files': script_generating_key_files,

        'config_url': args.config_url,
        'rosdistro_name': args.rosdistro_name,
        'release_build_name': args.release_build_name,
        'apt_mirror_args': apt_mirror_args,

        'ros_buildfarm_url': get_repository_url('.'),

        'credentials_src': os.path.join(
            '/var/lib/jenkins',
            os.path.dirname(get_relative_credential_path())),
        'credentials_dst': os.path.join(
            '/home/buildfarm',
            os.path.dirname(get_relative_credential_path())),

        'recipients': build_file.notify_emails,
    }
    job_config = expand_template(template_name, job_data)
    return job_config
def _get_job_config(
    args, config, recipients, template_name, additional_data=None
):
    repository_args, script_generating_key_files = \
        get_repositories_and_script_generating_key_files(config=config)

    job_data = dict(additional_data) if additional_data is not None else {}
    job_data.update({
        'script_generating_key_files': script_generating_key_files,

        'config_url': args.config_url,
        'rosdistro_name': args.rosdistro_name,
        'release_build_name': args.release_build_name,
        'repository_args': repository_args,

        'ros_buildfarm_repository': get_repository(),

        'credentials_src': os.path.join(
            '~', os.path.dirname(get_relative_credential_path())),
        'credentials_dst': os.path.join(
            '/home/buildfarm',
            os.path.dirname(get_relative_credential_path())),

        'recipients': recipients,
    })
    job_config = expand_template(template_name, job_data)
    return job_config
def get_reconfigure_jobs_job_config(args, config, build_file):
    template_name = 'doc/doc_reconfigure-jobs_job.xml.em'

    repository_args, script_generating_key_files = \
        get_repositories_and_script_generating_key_files(config=config)

    job_data = {
        'script_generating_key_files': script_generating_key_files,

        'config_url': args.config_url,
        'rosdistro_name': args.rosdistro_name,
        'doc_build_name': args.doc_build_name,
        'repository_args': repository_args,

        'ros_buildfarm_repository': get_repository(),

        'credentials_src': os.path.join(
            '~', os.path.dirname(get_relative_credential_path())),
        'credentials_dst': os.path.join(
            '/home/buildfarm',
            os.path.dirname(get_relative_credential_path())),

        'recipients': build_file.notify_emails,
    }
    job_config = expand_template(template_name, job_data)
    return job_config