aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-02-16 00:22:57 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-02-16 00:22:57 -0500
commit48ae409f64f26f652318a73c37fcd0de7d6e74e7 (patch)
tree6ab201784555b0a99c14756f4eb552cd2901915a /src
parentca4066feca64a310213b2e764f6214af82551034 (diff)
downloadstasis-48ae409f64f26f652318a73c37fcd0de7d6e74e7.tar.gz
Fix garbage file creation
* zero out proc structure * remove erroneous if statement that prevented OMC_JF_REPO from working correctly * fail if the artifactory repo is an empty string
Diffstat (limited to 'src')
-rw-r--r--src/deliverable.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/deliverable.c b/src/deliverable.c
index 3f0fd34..e2bbffb 100644
--- a/src/deliverable.c
+++ b/src/deliverable.c
@@ -1263,6 +1263,8 @@ int delivery_index_conda_artifacts(struct Delivery *ctx) {
void delivery_tests_run(struct Delivery *ctx) {
struct Process proc;
+ memset(&proc, 0, sizeof(proc));
+
if (!ctx->tests[0].name) {
msg(OMC_MSG_WARN | OMC_MSG_L2, "no tests are defined!\n");
} else {
@@ -1433,9 +1435,7 @@ int delivery_artifact_upload(struct Delivery *ctx) {
char *repo = getenv("OMC_JF_REPO");
if (repo) {
- if (!ctx->deploy[i].repo) {
- ctx->deploy[i].repo = strdup(repo);
- }
+ ctx->deploy[i].repo = strdup(repo);
} else if (globals.jfrog.repo) {
ctx->deploy[i].repo = strdup(globals.jfrog.repo);
} else {
@@ -1446,6 +1446,13 @@ int delivery_artifact_upload(struct Delivery *ctx) {
break;
}
+ if (isempty(ctx->deploy[i].repo) || !strlen(ctx->deploy[i].repo)) {
+ // Unlikely to trigger if the config parser is working correctly
+ msg(OMC_MSG_ERROR, "Artifactory repository path is empty. Cannot continue.\n");
+ status++;
+ break;
+ }
+
if (jfrt_auth_init(&ctx->deploy[i].auth_ctx)) {
continue;
}