From 5796ce9338c7fe2aa8a26766ff9e01448d785c99 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 3 Dec 2024 10:47:37 -0500 Subject: Add ability to use artifactory without uploading any artifacts at the end. * New option: --no-artifactory-upload * Implies --no-artifactory-build-info * Updated README.md --- src/cli/stasis/args.c | 2 ++ src/cli/stasis/args.h | 13 +++++++------ src/cli/stasis/stasis_main.c | 6 +++++- src/lib/core/globals.c | 1 + 4 files changed, 15 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/cli/stasis/args.c b/src/cli/stasis/args.c index ed11ab9..f3ce823 100644 --- a/src/cli/stasis/args.c +++ b/src/cli/stasis/args.c @@ -17,6 +17,7 @@ struct option long_options[] = { {"no-docker", no_argument, 0, OPT_NO_DOCKER}, {"no-artifactory", no_argument, 0, OPT_NO_ARTIFACTORY}, {"no-artifactory-build-info", no_argument, 0, OPT_NO_ARTIFACTORY_BUILD_INFO}, + {"no-artifactory-upload", no_argument, 0, OPT_NO_ARTIFACTORY_UPLOAD}, {"no-testing", no_argument, 0, OPT_NO_TESTING}, {"no-parallel", no_argument, 0, OPT_NO_PARALLEL}, {"no-rewrite", no_argument, 0, OPT_NO_REWRITE_SPEC_STAGE_2}, @@ -39,6 +40,7 @@ const char *long_options_help[] = { "Do not build docker images", "Do not upload artifacts to Artifactory", "Do not upload build info objects to Artifactory", + "Do not upload artifacts to Artifactory (dry-run)", "Do not execute test scripts", "Do not execute tests in parallel", "Do not rewrite paths and URLs in output files", diff --git a/src/cli/stasis/args.h b/src/cli/stasis/args.h index 932eac7..5bad752 100644 --- a/src/cli/stasis/args.h +++ b/src/cli/stasis/args.h @@ -10,12 +10,13 @@ #define OPT_NO_DOCKER 1001 #define OPT_NO_ARTIFACTORY 1002 #define OPT_NO_ARTIFACTORY_BUILD_INFO 1003 -#define OPT_NO_TESTING 1004 -#define OPT_OVERWRITE 1005 -#define OPT_NO_REWRITE_SPEC_STAGE_2 1006 -#define OPT_FAIL_FAST 1007 -#define OPT_NO_PARALLEL 1008 -#define OPT_POOL_STATUS_INTERVAL 1009 +#define OPT_NO_ARTIFACTORY_UPLOAD 1004 +#define OPT_NO_TESTING 1005 +#define OPT_OVERWRITE 1006 +#define OPT_NO_REWRITE_SPEC_STAGE_2 1007 +#define OPT_FAIL_FAST 1009 +#define OPT_NO_PARALLEL 1010 +#define OPT_POOL_STATUS_INTERVAL 1011 extern struct option long_options[]; void usage(char *progname); diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index 807dbbd..dc4e2d1 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -102,6 +102,10 @@ int main(int argc, char *argv[]) { case OPT_NO_ARTIFACTORY_BUILD_INFO: globals.enable_artifactory_build_info = false; break; + case OPT_NO_ARTIFACTORY_UPLOAD: + globals.enable_artifactory_build_info = false; + globals.enable_artifactory_upload = false; + break; case OPT_NO_TESTING: globals.enable_testing = false; break; @@ -561,7 +565,7 @@ int main(int argc, char *argv[]) { } if (want_artifactory) { - if (globals.enable_artifactory) { + if (globals.enable_artifactory && globals.enable_artifactory_upload) { msg(STASIS_MSG_L1, "Uploading artifacts\n"); delivery_artifact_upload(&ctx); } else { diff --git a/src/lib/core/globals.c b/src/lib/core/globals.c index 83465f1..0f0941a 100644 --- a/src/lib/core/globals.c +++ b/src/lib/core/globals.c @@ -37,6 +37,7 @@ struct STASIS_GLOBAL globals = { .enable_docker = true, ///< Toggle docker usage .enable_artifactory = true, ///< Toggle artifactory server usage .enable_artifactory_build_info = true, ///< Toggle build-info uploads + .enable_artifactory_upload = true, ///< Toggle artifactory file uploads .enable_testing = true, ///< Toggle [test] block "script" execution. "script_setup" always executes. .enable_rewrite_spec_stage_2 = true, ///< Leave template stings in output files .enable_parallel = true, ///< Toggle testing in parallel -- cgit