fix file upload

This commit is contained in:
Patrick Schratz 2024-07-24 18:51:51 +02:00
commit ab3d1ec103
Signed by: pat-s
GPG key ID: 3C6318841EF78925
2 changed files with 4 additions and 5 deletions

View file

@ -22,9 +22,8 @@ steps:
GIT_USER: pat-s
commands:
# download latest package version (avoid having to rebuild image every time)
# - git config credential.helper '!f() { sleep 1; echo "username=$${GIT_USER}"; echo "password=$${GIT_RO_TOKEN}"; }; f'
- git clone https://pat-s:$$git_ro_token@git.devxy.io/devxy/arm64-r-binaries.git && cd arm64-r-binaries
- R CMD INSTALL . > /dev/null
- R -q -e 'install.packages(".", repos = NULL, quiet = TRUE)'
- R -q -e 'options(crayon.enabled = TRUE, Ncpus = 2); pkgs = tools::CRAN_package_db()[[1]][1:2]; library(rBinaries); future::plan("sequential", workers = 2); lapply(pkgs, function(x) build_binary_package(x, build_for_minor=FALSE, debug = FALSE, force = TRUE))'
backend_options:
kubernetes:

View file

@ -26,14 +26,14 @@ upload_single_binary_to_s3 <- function(
s3fs::s3_file_system(
aws_access_key_id = Sys.getenv("AWS_ACCESS_KEY_ID"),
aws_secret_access_key = Sys.getenv("AWS_SECRET_ACCESS_KEY"),
endpoint = "https://s3.eu-central-003.backblazeb2.com",
region_name = "eu-central-003",
endpoint = endpoint,
region_name = region,
)
tarball_name <- sprintf("%s_%s.tar.gz", package_name, tag)
exists <- s3fs::s3_file_exists(sprintf("%s/%s", remote_bin_path, tarball_name))
if (!exists && !force) {
if ((!exists && !force) || (!exists && force)) {
cli::cli_alert_info("{.fun build_single_tag}: 5. Uploading {.pkg {package_name}} {.field {tag}} to S3.")
s3fs::s3_file_upload(
sprintf("%s/%s", local_bin_path, tarball_name),