Learn R Programming

gitlabr (version 0.9)

gl_ci_job: Define Gitlab CI jobs

Description

Define Gitlab CI jobs

Usage

gl_ci_job(job_name, stage = job_name, allowed_dependencies = c(), ...)

gl_default_ci_pipeline()

use_gitlab_ci(pipeline = gl_default_ci_pipeline(), image = "rocker/r-devel:latest", push_to_remotes = c(), path = ".gitlab-ci.yml", overwrite = TRUE, add_to_Rbuildignore = TRUE)

Arguments

job_name

Name of job template to get CI definition elements

stage

Name of stage job belongs to

allowed_dependencies

List of job names that are allowed to be listed as dependencies of jobs. Usually this is all existing other jobs.

...

passed on to ci_r_script: booleans vanilla or slave translate to R executable options with the same name

pipeline

a CI pipeline defined as a list of lists

image

Docker image to use in gitlab ci. If NULL, not specified!

push_to_remotes

named list of remotes the code should be pushed to. Only master is pushed and for every remote a job of stage "push" is generated. See example for how to use credentials from environment variables.

path

destination path for writing gitlab CI yml file

overwrite

whether to overwrite existing gitlab CI yml file

add_to_Rbuildignore

add CI yml file (from path) to .Rbuildignore?

Examples

Run this code
# NOT RUN {
gl_ci_job("build", allowed_dependencies = "test")
use_gitlab_ci(image = "pointsofinterest/gitlabr:latest")
use_gitlab_ci(image = "pointsofinterest/gitlabr:latest",
 push_to_remotes = list("github" =
 "https://${GITHUB_USERNAME}:${GITHUB_PASSWORD}@github.com/jirkalewandowski/gitlabr.git"))
# }

Run the code above in your browser using DataLab