when: - event: [cron] cron: update-package-index-alpine-322-amd64 - event: [cron] cron: update-package-index - event: manual evaluate: 'update_package_index == "alpine-322-amd64"' skip_clone: true steps: - name: Upload PACKAGES files image: docker.io/devxygmbh/rpkgs-build-env-ubuntu:noble-4.4 pull: true environment: RED_HAT_DEV_PW: from_secret: RED_HAT_DEV_PW HETZNER_S3_ACCESS_KEY_K3S: from_secret: HETZNER_S3_ACCESS_KEY_K3S HETZNER_S3_SECRET_KEY_K3S: from_secret: HETZNER_S3_SECRET_KEY_K3S PGPASS: from_secret: PGPASS GIT_RO_TOKEN: from_secret: GIT_RO_TOKEN GITHUB_PAT: from_secret: GITHUB_PAT # normal env vars GIT_USER: pat-s NTFY_SERVER: from_secret: NTFY_SERVER NTFY_TOPIC: from_secret: NTFY_TOPIC NTFY_AUTH: TRUE NTFY_PASSWORD: from_secret: ntfy_token # set the location of the 'pkgcache' cache dir which persists the R package dependencies needed to install the packages themselves R_PKG_CACHE_DIR: /mnt/cache/pkgcache R_LIBS_USER: /mnt/cache/R-pkgs # volumes: # - amd64-binaries-r-dep-cache-alpine-322:/mnt/cache commands: - git clone -q https://pat-s:$$GIT_RO_TOKEN@git.devxy.io/devxy/build-cran-binaries.git . - rm -rf /mnt/cache/packages/* - R -q -e 'pak::pak("git::https://codefloe.com/rpkgs/bincraft.git")' - R -q -e 'pak::pak("pat-s/cranlike@s3")' - R -q -e 'pak::pak("pat-s/desc@description-from-remote")' - R -q -e 'packageVersion("bincraft")' # - cd /mnt/cache/packages - R -q -e 'options(crayon.enabled = TRUE); library(bincraft); future::plan("multisession", workers = 4); library(progressr); handlers(global = TRUE); handlers("progress"); upload_package_index(codename = "alpine322", s3_endpoint = "https://hel1.your-objectstorage.com", s3_region = "hel1", s3_bucket = "devxy-r-package-binaries-hel1", s3_access_key_id = Sys.getenv("HETZNER_S3_ACCESS_KEY_K3S"), s3_secret_access_key = Sys.getenv("HETZNER_S3_SECRET_KEY_K3S"))' backend_options: kubernetes: resources: requests: memory: 3000Mi cpu: 2000m limits: memory: 3000Mi cpu: 8000m nodeSelector: kubernetes.io/arch: 'amd64' tolerations: - key: 'CI' operator: 'Equal' value: 'true' effect: 'NoSchedule' - name: Purge CDN cache image: curlimages/curl environment: BUNNYNET_API_KEY: from_secret: BUNNYNET_API_KEY commands: | curl -sL -X POST -H "AccessKey: $BUNNYNET_API_KEY" https://api.bunny.net/purge?url=https%3A%2F%2Fcran.devxy.io%2Famd64%2Falpine322%2Flatest%2Fsrc%2Fcontrib%2FPACKAGES&async=false curl -sL -X POST -H "AccessKey: $BUNNYNET_API_KEY" https://api.bunny.net/purge?url=https%3A%2F%2Fcran.devxy.io%2Famd64%2Falpine322%2Flatest%2Fsrc%2Fcontrib%2FPACKAGES.gz&async=false curl -sL -X POST -H "AccessKey: $BUNNYNET_API_KEY" https://api.bunny.net/purge?url=https%3A%2F%2Fcran.devxy.io%2Famd64%2Falpine322%2Flatest%2Fsrc%2Fcontrib%2FPACKAGES.rds&async=false curl -sL -X POST -H "AccessKey: $BUNNYNET_API_KEY" https://api.bunny.net/purge?url=https%3A%2F%2Fcran.devxy.io%2Famd64%2Falpine322%2Flatest%2Fsrc%2Fcontrib%2FPACKAGES.db&async=false curl -sL -X POST -H "AccessKey: $BUNNYNET_API_KEY" https://api.bunny.net/purge?url=https%3A%2F%2Fcran.devxy.io%2Famd64%2Falpine322%2Flatest%2Fsrc%2Fcontrib%2FPMeta%2FParchive.rds&async=false sleep 20 # need to wait a bit to successfully deliver API calls