browse_travis_token | R Documentation |
A Travis API Key is needed to interact with the Travis API.
browse_travis_token()
opens a browser window for the respective Travis
endpoint. On this site, you can copy your personal API key and then follow
the instructions of the console output or the ones shown below.
browse_travis_token(endpoint = get_endpoint())
endpoint |
|
The travis package supports two ways of storing the Travis API key(s):
via env vars R_TRAVIS_ORG
and R_TRAVIS_COM
via ~/.travis/config.yml
The latter should already be present if you already used the Travis CI CLI tool at some point in the past. However, for simplicity we recommend to use the env var approach.
To store the API key as an env var, add the following to ~/.Renviron
and
restart R. You only need to store API keys for the Travis endpoint you are
using. You can store both if you want.
R_TRAVIS_COM = <your API key here> R_TRAVIS_ORG = <your API key here>
If you still want to use the config file approach, the following
instructions should help to set up ~/.travis/config.yml
correctly:
Copy the token from the browser window which just opened. You can use
edit_travis_config()
to open ~/.travis/config.yml
.
The token should be stored using the following structure
endpoints: https://api.travis-ci.<endpoint>/: access_token: <token>
with <endpoint>
being either 'com' or 'org'.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.