Skip to content

Commit e3ff8dc

Browse files
committed
uses single rspatial script for both images
1 parent 9a9e526 commit e3ff8dc

File tree

5 files changed

+23
-68
lines changed

5 files changed

+23
-68
lines changed

.github/workflows/docker-mapme.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
pull_request:
1010
branches: [main, master]
1111
env:
12-
tag: 1.4.1
12+
tag: 1.4.2
1313

1414
jobs:
1515

dockerfiles/mapme-spatial-dev.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LABEL org.opencontainers.image.title="mapme-spatial-dev" \
77
org.opencontainers.image.description="A build of spatial libraries for use within MAPME" \
88
org.opencontainers.image.authors="Darius Görgen <info@dariusgoergen.com>"
99

10-
COPY scripts/install_rspatial_dev.sh /rocker_scripts/install_rspatial_dev.sh
11-
RUN chmod +x /rocker_scripts/install_rspatial_dev.sh
10+
COPY scripts/install_rspatial.sh /rocker_scripts/install_rspatial.sh
11+
RUN chmod +x /rocker_scripts/install_rspatial.sh
1212
ARG NCPUS=-1
13-
RUN bash /rocker_scripts/install_rspatial_dev.sh -ncpus $NCPUS
13+
RUN bash /rocker_scripts/install_rspatial.sh -n $NCPUS -d

dockerfiles/mapme-spatial.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ LABEL org.opencontainers.image.title="mapme-spatial" \
1010
COPY scripts/install_rspatial.sh /rocker_scripts/install_rspatial.sh
1111
RUN chmod +x /rocker_scripts/install_rspatial.sh
1212
ARG NCPUS=-1
13-
RUN bash /rocker_scripts/install_rspatial.sh -ncpus $NCPUS
13+
RUN bash /rocker_scripts/install_rspatial.sh -n $NCPUS

scripts/install_rspatial.sh

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#!/bin/bash
22
set -e
33

4-
while getopts ncpus: flag
4+
DEV=0
5+
6+
while getopts "dn:" flag
57
do
68
case "${flag}" in
7-
ncpus) NCPUS=${OPTARG};;
9+
n) NCPUS=${OPTARG};;
10+
d) DEV=1;;
811
esac
912
done
1013

@@ -16,11 +19,20 @@ install2.r --deps TRUE --ncpus $NCPUS --type source --repos https://cloud.r-proj
1619
sf \
1720
stars \
1821
terra \
19-
gdalcubes \
20-
mapme.biodiversity
22+
gdalcubes
2123

22-
# install mapme packages
23-
Rscript -e 'remotes::install_github("mapme-initiative/mapme.pipelines", dependencies = TRUE)'
24+
# install mapme.biodiversity dev or cran version
25+
if [ $DEV -eq 1 ]; then
26+
echo "Installing dev version of mapme.biodiversity"
27+
Rscript -e 'remotes::install_github("mapme-initiative/mapme.biodiversity", dependencies = TRUE)'
28+
else
29+
echo "Installing CRAN version of mapme.biodiversity"
30+
install2.r --deps TRUE --ncpus $NCPUS --type source --repos https://cloud.r-project.org \
31+
mapme.biodiversity
32+
fi
33+
34+
# install other mapme packages from github
35+
Rscript -e 'remotes::install_github("mapme-initiative/mapme.pipelines", dependencies = TRUE)'
2436

2537
# install additional r packages
2638
install2.r --error --skipmissing --skipinstalled --ncpus $NCPUS \

scripts/install_rspatial_dev.sh

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)