write shiny app
create an R package for the app
build package
check package
test package + shiny app
write a Dockerfile for the app
build docker image
deploy docker image
July 11, 2019
write shiny app
create an R package for the app
build package
check package
test package + shiny app
write a Dockerfile for the app
build docker image
deploy docker image
write shiny app
create an R package for the app
→ build package
→ check package
→ test package + shiny app
write a Dockerfile for the app
→ build docker image
→ deploy docker image
CI/CD pipeline which is
pipeline { agent any stages { stage('Roxygen') { steps { sh 'R -e \'roxygen2::roxygenize("myPackage")\'' } } stage('Build') { steps { sh 'R CMD build myPackage' } } } }
library(rjenkins) jc <- jenkins("http://localhost", user = "dseyaeve", token = "my-token")
jc %>% listJobs()
## [1] "demoApp" "my-jenkins-folder" "my-jenkins-job" ## [4] "my-other-jenkins-job"
job <- jc %>% getView("all") %>% getJob("my-jenkins-job") job %>% scheduleBuild() job %>% summary() job %>% getBuildLog() job %>% listArtifacts()
ppl <- pipeline( agent("any"), stages( stage("Roxygen", steps( R(roxygen2::roxygenize('myPackage')) ) ), stage("Build", steps( R(pkgbuild::build('myPackage')) ) ) ) )
job %>% createJob("new-job", pipelineConfig(pipeline = ppl))
jc %>% createJob("demoApp", multibranchPipelineConfig( gitHubBranchSource(owner = "dseynaev", repository = "rjenkins-demo-shiny", credentialsId = "github-dseynaev")))
job <- jc %>% getJob("demoApp", "master")
library(rundeck) rc <- rundeck("http://localhost", user = "dseynaeve", token = "my-token")
rc %>% rrundeck::listProjects()
## name description label ## 1 UseR2019 Demo jobs for UseR! 2019 UseR! 2019
rc %>% rrundeck::getProject("UseR2019") %>% rrundeck::listJobs()
## name description ## 1 docker-pull # Update an image by pulling from docker hub ## id ## 1 087af941-02dc-4c81-bcee-59b13c8f4fd6
job <- rc %>% getProject("UseR2019") %>% getJob(name = "docker-pull") job %>% run(list(image = "openanalytics/rjenkins-demo-app"), follow = TRUE)
www.openanalytics.eu
daan.seynaeve@openanalytics.eu