diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-12-03 10:47:37 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-12-03 19:07:23 -0500 |
commit | 5796ce9338c7fe2aa8a26766ff9e01448d785c99 (patch) | |
tree | 2bdbf64f25753f8d53b408b62b78f524cbe3ca0d | |
parent | 9098abc13882e6b665e46361721d3bcba7da55eb (diff) | |
download | stasis-5796ce9338c7fe2aa8a26766ff9e01448d785c99.tar.gz |
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
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | include/core.h | 1 | ||||
-rw-r--r-- | src/cli/stasis/args.c | 2 | ||||
-rw-r--r-- | src/cli/stasis/args.h | 13 | ||||
-rw-r--r-- | src/cli/stasis/stasis_main.c | 6 | ||||
-rw-r--r-- | src/lib/core/globals.c | 1 |
6 files changed, 18 insertions, 7 deletions
@@ -163,6 +163,8 @@ stasis mydelivery.ini | --overwrite | n/a | Overwrite an existing release | | --no-docker | n/a | Do not build docker images | | --no-artifactory | n/a | Do not upload artifacts to Artifactory | +| --no-artifactory-build-info| n/a | Do not upload build info objects to Artifactory | +| --no-artifactory-upload | n/a | Do not upload artifacts to Artifactory (dry-run) | | --no-testing | n/a | Do not execute test scripts | | --no-parallel | n/a | Do not execute tests in parallel | | --no-rewrite | n/a | Do not rewrite paths and URLs in output files | diff --git a/include/core.h b/include/core.h index b8b047f..362ac8d 100644 --- a/include/core.h +++ b/include/core.h @@ -40,6 +40,7 @@ struct STASIS_GLOBAL { bool enable_docker; //!< Enable docker image builds bool enable_artifactory; //!< Enable artifactory uploads bool enable_artifactory_build_info; //!< Enable build info (best disabled for pure test runs) + bool enable_artifactory_upload; //!< Enable artifactory file upload (dry-run when false) bool enable_testing; //!< Enable package testing bool enable_overwrite; //!< Enable release file clobbering bool enable_rewrite_spec_stage_2; //!< Enable automatic @STR@ replacement in output files 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 |