From 6626843a03a41fecdd3b07a8b45a5c43d6679bd6 Mon Sep 17 00:00:00 2001 From: pat-s Date: Thu, 25 Jul 2024 00:05:03 +0200 Subject: [PATCH] test build --- .woodpecker/build.yaml | 4 ++-- R/metadata-build.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.woodpecker/build.yaml b/.woodpecker/build.yaml index f7be1ba..a71a5b5 100644 --- a/.woodpecker/build.yaml +++ b/.woodpecker/build.yaml @@ -28,8 +28,8 @@ steps: # download latest package version (avoid having to rebuild image every time) # rscript_startup arg: required to pass down global option to future workers https://github.com/HenrikBengtsson/future/issues/134#issuecomment-2245666169 - git clone https://pat-s:$$git_ro_token@git.devxy.io/devxy/arm64-r-binaries.git && cd arm64-r-binaries - - R -q -e 'install.packages(".", repos = NULL, quiet = TRUE); packageVersion("rBinaries")' - - R -q -e 'options(crayon.enabled = TRUE, Ncpus = 4, future.globals.onReference = "error"); pkgs = tools::CRAN_package_db()[[1]][1:20]; library(rBinaries); future::plan("multisession", workers = 4, rscript_startup = quote(options(crayon.enabled = TRUE))); foo = lapply(pkgs, function(x) build_binary_package(x, build_for_minor=FALSE, debug = FALSE, force = TRUE))' + - R -q -e 'install.packages(".", repos = NULL, quiet = FALSE); packageVersion("rBinaries")' + - R -q -e 'options(crayon.enabled = TRUE, Ncpus = 4, future.globals.onReference = "error"); pkgs = tools::CRAN_package_db()[[1]][17:17]; library(rBinaries); future::plan("multisession", workers = 4, rscript_startup = quote(options(crayon.enabled = TRUE))); foo = lapply(pkgs, function(x) build_binary_package(x, build_for_minor=FALSE, debug = FALSE, force = TRUE))' backend_options: kubernetes: resources: diff --git a/R/metadata-build.R b/R/metadata-build.R index 5ee3621..95af938 100644 --- a/R/metadata-build.R +++ b/R/metadata-build.R @@ -1,7 +1,7 @@ #' @importFrom DBI dbConnect dbDisconnect dbWriteTable dbGetQuery dbExecute store_build_metadata <- function( package_name, tag, platform, - error_occurred, error, force = FALSE, error = NULL) { + error_occurred, force = FALSE, error = NULL) { con <- DBI::dbConnect(RPostgres::Postgres(), dbname = "build_metadata", host = "postgres-arm-binaries-r.devxy.io", port = 15432, user = "arm_binaries", password = Sys.getenv("PGPASS") @@ -18,7 +18,7 @@ store_build_metadata <- function( } else if (nrow(existing_entries) >= 1 && force) { cli::cli_alert_info("{.fun store_build_metadata}: Force overwriting build metadata for {.pkg {package_name}} {.field {tag}} because {.code force = TRUE} was set.") - dbExecute(con, sprintf("UPDATE single_builds SET build_timestamp = '%s', error_occurred = %s, error = '%s' WHERE package_name = '%s' and tag = '%s'", format(Sys.time(), "%Y-%m-%d %H:%M:%S"), error_occurred, error, package_name, tag)) + DBI::dbExecute(con, sprintf("UPDATE single_builds SET build_timestamp = '%s', error_occurred = %s, error = '%s' WHERE package_name = '%s' and tag = '%s'", format(Sys.time(), "%Y-%m-%d %H:%M:%S"), error_occurred, error, package_name, tag)) } else if (nrow(existing_entries) == 0) { cli::cli_alert("{.fun store_build_metadata}: Storing build metadata for {.pkg {package_name}} {.field {tag}}.") # Create a data frame with the metadata