get_env_vars: Manage environment variables

Description Usage Arguments Details Value See Also Examples

Description

These functions retrieve and modify environment variables for the Travis-CI build environment, as a possible alternative to specifying them in a .travis.yml file.

Usage

1
2
3
4
5
6
7
get_env_vars(repo, id, ...)

add_env_vars(repo, evar, public = TRUE, ...)

update_env_vars(repo, id, evar, public, ...)

delete_env_var(repo, id, ...)

Arguments

repo

A character string specifying a repo slug (i.e., cloudyr/travisci) a numeric Travis-CI repository ID, or an object of class “travis_repo”. If a slug is used, it will be implicitly converted to a repository ID in some cases where only the latter is accepted.

id

An alphanumeric ID for a given environment variable or an object of class “travis_envvar”, for example as returned by one of these functions.

...

Additional arguments passed to travisHTTP.

evar

A list of environment variables as key-value pairs.

Details

This can be useful for checking, creating, updating, or deleting environment variables used as build settings. See hrefhttp://docs.travis-ci.com/user/environment-variables/the API documentation for full details.

Value

A list of objects of class “travis_envvar”, except for delete_env_vars, which returns a logical.

See Also

get_encryption_key, for handling encrypted environment variables

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
# authenticate based on Sys.setenv("GITHUB_TOKEN" = "sometoken")
auth_travis()

# get environment variables for a repo
get_env_vars("cloudyr/travisci")

# get a specific environment variable based on its ID
get_env_vars("cloudyr/travisci", id = 12345)

# set environment variables
e <- add_env_vars("cloudyr/travisci", var = list(VAR1 = "value1", VAR2 = "value2"))

# update an environment variable
update_env_vars("cloudyr/travisci", id = e$id, 
                 var = list(VAR1 = "newvalue")

# delete an environment variable
delete_env_vars("cloudyr/travisci", id = e$id)


## End(Not run)

cloudyr/travisci documentation built on May 13, 2019, 8:22 p.m.