Fail if any R packages fails to install

This commit is contained in:
Andrea Dell'Amico 2023-04-20 16:19:43 +02:00
parent f9c929f7d7
commit f2408fb4bb
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ RUN apt-get update --yes && \
# Install the R packages we need, using the binary distribution
# at https://packagemanager.rstudio.com/client/#/repos/1/overview
ADD https://code-repo.d4science.org/gCubeSystem/r-packages-list/raw/branch/master/install2r-packages.txt /tmp
RUN for f in `cat /tmp/install2r-packages.txt` ; do install2.r --error --skipinstalled --ncpus -1 $f ; done
RUN for f in `cat /tmp/install2r-packages.txt` ; do install2.r --error --skipinstalled --ncpus -1 $f || exit 1 ; done
# Non CRAN repositories
ADD https://code-repo.d4science.org/gCubeSystem/r-packages-list/raw/branch/master/r_non_cran_pkgs.txt /tmp
@ -54,7 +54,7 @@ RUN for l in `cat /tmp/r_non_cran_pkgs.txt` ; do \
pkg=`echo $l | cut -d : -f 1` ; \
mirror=`echo $l | cut -d : -f 2-` ; \
Rscript --slave --no-site-file --no-init-file --no-save --no-restore-history \
-e "install.packages(pkgs='$pkg', repos=c('$mirror/'));" ; done
-e "install.packages(pkgs='$pkg', repos=c('$mirror/'));" || exit 1 ; done
# Install some CRAN packages from source
ADD https://code-repo.d4science.org/gCubeSystem/r-packages-list/raw/branch/master/jupyter-image-r-cran-pkgs.txt /tmp
@ -62,7 +62,7 @@ RUN for cr in `cat /tmp/jupyter-image-r-cran-pkgs.txt` ; do \
pkg=`echo $cr` ; \
mirror='https://cloud.r-project.org' ; \
Rscript --slave --no-site-file --no-init-file --no-save --no-restore-history \
-e "install.packages(pkgs='$pkg', repos=c('$mirror/'));" ; done
-e "install.packages(pkgs='$pkg', repos=c('$mirror/'));" || exit 1 ; done
# From github
ADD https://code-repo.d4science.org/gCubeSystem/r-packages-list/raw/branch/master/r_github_pkgs.txt /tmp