Ejemplo n.º 1
0
def email_release_drivers(
    addresses,
    product,
    version,
    build_number,
    repo,
    revision,
    task_group_id,
):
    # Send an email to the mailing after the build
    email_buglist_string = create_bugs_url(product, version, revision, repo=repo)

    content = """\
A new build has been started:

Commit: [{revision}]({repo}/rev/{revision})
Task group: [{task_group_id}]({root_url}/tasks/groups/{task_group_id})

{email_buglist_string}
""".format(
        repo=repo,
        revision=revision,
        root_url=os.environ["TASKCLUSTER_ROOT_URL"],
        task_group_id=task_group_id,
        email_buglist_string=email_buglist_string,
    )

    # On r-d, we prefix the subject of the email in order to simplify filtering
    subject_prefix = ""
    if product in {"fennec"}:
        subject_prefix = "[mobile] "
    if product in {"firefox", "devedition"}:
        subject_prefix = "[desktop] "

    subject = "{} Build of {} {} build {}".format(
        subject_prefix, product, version, build_number
    )

    # use proxy if configured, otherwise local credentials from env vars
    if "TASKCLUSTER_PROXY_URL" in os.environ:
        notify_options = {"rootUrl": os.environ["TASKCLUSTER_PROXY_URL"]}
    else:
        notify_options = optionsFromEnvironment()

    notify = Notify(notify_options)
    for address in addresses:
        notify.email(
            {
                "address": address,
                "subject": subject,
                "content": content,
            }
        )
Ejemplo n.º 2
0
def email_release_drivers(
    addresses,
    product,
    version,
    build_number,
    repo,
    revision,
    task_group_id,
):
    # Send an email to the mailing after the build
    email_buglist_string = create_bugs_url(product,
                                           version,
                                           revision,
                                           repo=repo)

    content = """\
A new build has been started:

Commit: [{revision}]({repo}/rev/{revision})
Task group: [{task_group_id}](https://tools.taskcluster.net/groups/{task_group_id})

{email_buglist_string}
""".format(repo=repo,
           revision=revision,
           task_group_id=task_group_id,
           email_buglist_string=email_buglist_string)

    # On r-d, we prefix the subject of the email in order to simplify filtering
    subject_prefix = ""
    if product in {"fennec"}:
        subject_prefix = "[mobile] "
    if product in {"firefox", "devedition"}:
        subject_prefix = "[desktop] "

    subject = '{} Build of {} {} build {}'.format(subject_prefix, product,
                                                  version, build_number)

    notify_options = {}
    if 'TASKCLUSTER_PROXY_URL' in os.environ:
        # Until bug 1460015 is finished, use the old baseUrl style of proxy URL
        base_url = os.environ['TASKCLUSTER_PROXY_URL'].rstrip('/')
        notify_options['baseUrl'] = '{}/notify/v1'.format(base_url)
    notify = Notify(notify_options)
    for address in addresses:
        notify.email({
            'address': address,
            'subject': subject,
            'content': content,
        })