update package index after each build
This commit is contained in:
parent
17b8d44c7b
commit
c408dd1e9e
1 changed files with 64 additions and 6 deletions
|
|
@ -135,6 +135,10 @@ build_binary_package <- function(package_name, tag = NULL, codename = NULL,
|
|||
}, package_name, tag, future.seed = TRUE)
|
||||
})
|
||||
|
||||
cli::cli_h2("Updating package index for package ({.pkg {package_name[1]}})")
|
||||
|
||||
add_to_package_index(package_name[1])
|
||||
|
||||
return(invisible(TRUE))
|
||||
}
|
||||
|
||||
|
|
@ -186,10 +190,10 @@ build_single_tag <- function(
|
|||
cli::cli_alert("{.fun build_single_tag}: (3/3) Removing {.path {local_clone_dir_single}}.")
|
||||
unlink(local_clone_dir_single, force = TRUE, recursive = TRUE)
|
||||
|
||||
total_build_time <- round(difftime(Sys.time(), t1, units = "secs"), 2)
|
||||
total_build_time <- round(as.numeric(difftime(Sys.time(), t1, units = "secs")), 2)
|
||||
|
||||
# bytes to MB in binary format
|
||||
file_size <- as.numeric(fs::file_size(sprintf("%s/%s_%s.tar.gz", dir_out_bin, package_name, tag))) / (1024^2)
|
||||
file_size <- round(as.numeric(fs::file_size(sprintf("%s/%s_%s.tar.gz", dir_out_bin, package_name, tag))) / (1024^2), 2)
|
||||
|
||||
# skip DB connection if package already exists
|
||||
if (file.exists(sprintf("%s/%s_%s.tar.gz", dir_out_bin, package_name, tag))) {
|
||||
|
|
@ -197,12 +201,12 @@ build_single_tag <- function(
|
|||
dbname = "build_metadata", host = "postgres-arm-binaries-r.devxy.io",
|
||||
port = 15432, user = "arm_binaries", password = Sys.getenv("PGPASS")
|
||||
)
|
||||
dbExecute(con, sprintf(
|
||||
dbExecute(con,
|
||||
"UPDATE single_builds SET build_duration = $1, size = $2 WHERE package_name = $3 and platform = $4 and tag = $5",
|
||||
params = list(
|
||||
total_build_time, file_size, package_name, platform, tag
|
||||
)
|
||||
))
|
||||
)
|
||||
dbDisconnect(con)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue