aboutsummaryrefslogtreecommitdiff
path: root/src/cli/stasis
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/stasis')
-rw-r--r--src/cli/stasis/args.c2
-rw-r--r--src/cli/stasis/args.h13
-rw-r--r--src/cli/stasis/stasis_main.c28
3 files changed, 35 insertions, 8 deletions
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 093e32e..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;
@@ -220,11 +224,31 @@ int main(int argc, char *argv[]) {
// Safety gate: Avoid clobbering a delivered release unless the user wants that behavior
msg(STASIS_MSG_L1, "Checking release history\n");
- if (delivery_exists(&ctx)) {
+ if (!globals.enable_overwrite && delivery_exists(&ctx) == DELIVERY_FOUND) {
msg(STASIS_MSG_ERROR | STASIS_MSG_L1, "Refusing to overwrite release: %s\nUse --overwrite to enable release clobbering.\n", ctx.info.release_name);
exit(1);
}
+ if (globals.enable_artifactory) {
+ // We need to download previous revisions to ensure processed packages are available at build-time
+ // This is also a docker requirement. Python wheels must exist locally.
+ if (ctx.meta.rc > 1) {
+ msg(STASIS_MSG_L1, "Syncing delivery artifacts for %s\n", ctx.info.build_name);
+ if (delivery_series_sync(&ctx) != 0) {
+ msg(STASIS_MSG_ERROR | STASIS_MSG_L2, "Unable to sync artifacts for %s\n", ctx.info.build_name);
+ msg(STASIS_MSG_L3, "Case #1:\n"
+ "\tIf this is a new 'version', and 'rc' is greater "
+ "than 1, then no previous deliveries exist remotely. "
+ "Reset 'rc' to 1.\n");
+ msg(STASIS_MSG_L3, "Case #2:\n"
+ "\tThe Artifactory server %s is unreachable, or the credentials used "
+ "are invalid.\n", globals.jfrog.url);
+ // No continue-on-error check. Without the previous delivery nothing can be done.
+ exit(1);
+ }
+ }
+ }
+
// Unlikely to occur: this should help prevent rmtree() from destroying your entire filesystem
// if path is "/" then, die
// or if empty string, die
@@ -541,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 {