Skip to content

Commit 13cab96

Browse files
committed
build: add filles and update scripts to generate geospatial-dev-osgeo docker-bake.json
1 parent e954696 commit 13cab96

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

build/scripts/generate-bakefiles.R

+37
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,30 @@ write_extra_bakefile <- function(..., bakefile_template, path_template) {
209209
}
210210

211211

212+
write_experimental_bakefile <- function(..., bakefile_template, path_template) {
213+
dots <- rlang::list2(...)
214+
215+
glue::glue_data(
216+
dots,
217+
bakefile_template,
218+
.open = "{{",
219+
.close = "}}",
220+
.trim = FALSE
221+
) |>
222+
jsonlite::fromJSON(simplifyVector = FALSE) |>
223+
jsonlite::write_json(
224+
path = glue::glue_data(
225+
dots,
226+
path_template,
227+
.open = "{{",
228+
.close = "}}"
229+
),
230+
pretty = TRUE,
231+
auto_unbox = TRUE
232+
)
233+
}
234+
235+
212236
#' Outer paste of vectors
213237
#' @param ... Character vectors to paste
214238
#' @return A character vector
@@ -284,3 +308,16 @@ df_args |>
284308
)
285309
}
286310
)
311+
312+
# Experimental images' bake files
313+
df_args |>
314+
utils::tail(1) |>
315+
purrr::pwalk(
316+
\(...) {
317+
write_experimental_bakefile(
318+
...,
319+
bakefile_template = readr::read_file("build/templates/bakefiles/experimental.docker-bake.json"),
320+
path_template = "bakefiles/experimental.docker-bake.json"
321+
)
322+
}
323+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"group": [
3+
{
4+
"default": [
5+
{
6+
"targets": ["geospatial-dev-osgeo"]
7+
}
8+
],
9+
"osgeo": [
10+
{
11+
"targets": ["geospatial-dev-osgeo"]
12+
}
13+
]
14+
}
15+
],
16+
"target": {
17+
"geospatial-dev-osgeo": {
18+
"dockerfile": "dockerfiles/geospatial-dev-osgeo.Dockerfile",
19+
"labels": {
20+
"org.opencontainers.image.title": "rocker/geospatial on dev-osgeo",
21+
"org.opencontainers.image.description": "Docker-based Geospatial toolkit for R, built on versioned Rocker image.",
22+
"org.opencontainers.image.base.name": "docker.io/rocker/verse:{{r_version}}",
23+
"org.opencontainers.image.version": "R-{{r_version}}"
24+
},
25+
"platforms": ["linux/amd64"],
26+
"tags": [
27+
"docker.io/rocker/geospatial:dev-osgeo",
28+
"ghcr.io/rocker-org/geospatial:dev-osgeo"
29+
],
30+
"cache-from": [
31+
"docker.io/rocker/geospatial:dev-osgeo",
32+
"ghcr.io/rocker-org/geospatial:dev-osgeo"
33+
],
34+
"cache-to": ["type=inline"]
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)