Commit 50c90935 authored by Romain Lesur's avatar Romain Lesur
Browse files

More details

parent acbb947d
Pipeline #11823510 passed with stage
in 1 minute and 50 seconds
......@@ -3,8 +3,22 @@
A comprehensive documentation of `GitLab Pages` can be found here: https://docs.gitlab.com/ee/user/project/pages.
## `GitLab CI` configuration file {#CI-file-details}
`GitLab CI` configuration file is a `YAML` file.
The the configuration file begins with `image` declaration. It indicates to the `GitLab Runner` which [`Docker`](https://www.docker.com/) image it has to pull for executing the `CI` job.
```{r comment=NA, class.output='yaml', echo=FALSE}
readLines("./.gitlab-ci.yml") %>%
grep("image:", ., fixed = TRUE)
image <-
readLines("./.gitlab-ci.yml") %>%
stringr::str_subset("image") %T>%
cat() %>%
yaml::yaml.load() %$%
image %>%
stringr::str_split(":") %>%
unlist()
```
In order to build a website with `bookdown`, you have to choose a [`Docker`](https://www.docker.com/) image with `bookdown` installed. In this example, the `r image[1] %>% paste0("[\u0060", ., "\u0060](https://hub.docker.com/r/", ., ")")` image is used: [`Rocker`](https://www.rocker-project.org/) is the [official `R` image for `Docker`](http://dirk.eddelbuettel.com/blog/2014/12/19/). I am a newbie with [`Docker`](https://www.docker.com/) and I recommend this [rOpenSci](https://ropensci.org/)'s [Docker tutorial for reproducible research](http://ropenscilabs.github.io/r-docker-tutorial/).
Using a `Rocker` image, **you ensure the reproducibility of your `bookdown` website**.
......@@ -30,7 +30,6 @@ output:
library(magrittr)
```
```{r write-bib, include=FALSE}
knitr::write_bib(c(.packages(), 'bookdown'), 'packages.bib')
```
......@@ -50,7 +49,7 @@ These features are also present in the open source software [`GitLab Community E
## Add a `GitLab CI` configuration file {-}
Add the following `.gitlab-ci.yml` file in the root of the project:
```{r write-ci-file, comment=NA, class.output='yaml', echo=FALSE}
```{r insert-ci-file, comment=NA, class.output='yaml', echo=FALSE}
cat(readChar("./.gitlab-ci.yml", 1e5))
```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment