"""
Trigger the conda-forge.github.io Travis job to restart.
"""


import os

import requests
import six

import conda_smithy.ci_register


def rebuild_travis(repo_slug):
    headers = conda_smithy.ci_register.travis_headers()

    # If we don't specify the API version, we get a 404.
    # Also fix the accepted content type.
    headers["Accept"] = "application/json"
    headers["Travis-API-Version"] = "3"

    # Trigger a build on `master`.
    encoded_slug = six.moves.urllib.parse.quote(repo_slug, safe='')
    url = 'https://api.travis-ci.org/repo/{}/requests'.format(encoded_slug)
    response = requests.post(
        url,
        json={"request": {"branch": "master"}},
        headers=headers
    )
    if response.status_code != 201:
        response.raise_for_status()


if __name__ == '__main__':
    rebuild_travis('conda-forge/conda-forge.github.io')

@@ -644,39 +644,159 @@
 on=%7B
-%22request%22: %7B%22branch%22: %22master%22%7D
+%0A            %22request%22: %7B%0A                %22branch%22: %22master%22,%0A                %22message%22: %22Triggering build from staged-recipes%22,%0A            %7D%0A        
 %7D,%0A 

Add message to webpage repo trigger