From 080866ee9400dbc1cf82a71621e55cb20861f6e8 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 3 Dec 2024 00:57:34 -0500 Subject: Add DELIVERY_[NOT_]FOUND defines * Add delivery_series_sync function to download previously delivered files from artifactory --- src/lib/core/delivery_artifactory.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/lib/core/delivery_artifactory.c b/src/lib/core/delivery_artifactory.c index b69615e..9ad5829 100644 --- a/src/lib/core/delivery_artifactory.c +++ b/src/lib/core/delivery_artifactory.c @@ -185,3 +185,20 @@ int delivery_mission_render_files(struct Delivery *ctx) { return 0; } +int delivery_series_sync(struct Delivery *ctx) { + struct JFRT_Download dl = {0}; + + char *remote_dir = NULL; + if (asprintf(&remote_dir, "%s/%s/%s/(*)", globals.jfrog.repo, ctx->meta.mission, ctx->info.build_name) < 0) { + SYSERROR("%s", "Unable to allocate bytes for remote directory path"); + return -1; + } + + char *dest_dir = NULL; + if (asprintf(&dest_dir, "%s/{1}", ctx->storage.output_dir) < 0) { + SYSERROR("%s", "Unable to allocate bytes for destination directory path"); + return -1; + } + + return jfrog_cli_rt_download(&ctx->deploy.jfrog_auth, &dl, remote_dir, dest_dir); +} -- cgit