From c2cfd804d3d64cdf2b07e4f111e2f0133d3618ea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Facundo=20Mu=C3=B1oz?= <facundo.munoz@cirad.fr>
Date: Sat, 30 Oct 2021 14:51:34 +0200
Subject: [PATCH 1/2] Add utility docker_ci.sh to replicate the CI environment
 locally.

---
 .Rbuildignore | 1 +
 docker_ci.sh  | 8 ++++++++
 2 files changed, 9 insertions(+)
 create mode 100755 docker_ci.sh

diff --git a/.Rbuildignore b/.Rbuildignore
index 4862ff0..872c752 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -8,3 +8,4 @@
 ^public$
 ^pkgdown$
 ^data-raw$
+^docker_ci\.sh$
diff --git a/docker_ci.sh b/docker_ci.sh
new file mode 100755
index 0000000..c1d18d3
--- /dev/null
+++ b/docker_ci.sh
@@ -0,0 +1,8 @@
+## Reproduce the CI environment with:
+docker run --rm -it \
+  -v "$(pwd)":"/opt/$(basename $(pwd))" \
+  -w "/opt/$(basename $(pwd))" \
+  -e R_LIBS_USER="/opt/$(basename $(pwd))/ci/lib" \
+  -e CHECK_DIR="/opt/$(basename $(pwd))/ci/logs" \
+  -e BUILD_LOGS_DIR="/opt/$(basename $(pwd))/ci/logs/$(basename $(pwd)).Rcheck" \
+  rocker/geospatial bash
-- 
GitLab


From b205ca5b79169c7732ba2299e5b0d91bce274c7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Facundo=20Mu=C3=B1oz?= <facundo.munoz@cirad.fr>
Date: Sat, 30 Oct 2021 14:54:45 +0200
Subject: [PATCH 2/2] Add dependencies DiagrammeR and DiagrammeRsvg for
 building the pkgdown site with {dm}.

---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 694d64a..43401d6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -23,7 +23,7 @@ building:
     - mkdir -p $R_LIBS_USER $BUILD_LOGS_DIR
     - Rscript -e "remotes::install_deps(dependencies = TRUE, lib = Sys.getenv('R_LIBS_USER'))"
     # Install packages required by covr and pkgdown
-    - Rscript -e "install.packages(c('DT', 'pkgdown'), lib = Sys.getenv('R_LIBS_USER'))"
+    - Rscript -e "install.packages(c('DT', 'pkgdown', 'DiagrammeR', 'DiagrammeRsvg'), lib = Sys.getenv('R_LIBS_USER'))"
     # Use --no-environ to prevent setting the environment variable R_LIBS from Rprofile.site
     # which caused R_LIBS_USER to appear last in .libPaths(), which in turn prevented check()
     # to find the packages installed in R_LIBS_USER, leading to a installation error.
-- 
GitLab