aboutsummaryrefslogtreecommitdiff
path: root/src/cli/stasis/stasis_main.c
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2024-12-07 19:53:44 -0500
committerGitHub <noreply@github.com>2024-12-07 19:53:44 -0500
commit456c5a481a7dabb53434a696488ac6eecb962d5b (patch)
tree8f4743a4cfdad61f9aeac0dffce050e5bd9eef1d /src/cli/stasis/stasis_main.c
parentbdadebfceffad22179b33948113b2bf82f02c1f7 (diff)
parent4c403d1f1318a163b017605c2af6d1a14c579f99 (diff)
downloadstasis-456c5a481a7dabb53434a696488ac6eecb962d5b.tar.gz
Merge pull request #74 from jhunkeler/with-indexer-tlc
Combined: indexer-tlc and clone-existing-directory
Diffstat (limited to 'src/cli/stasis/stasis_main.c')
-rw-r--r--src/cli/stasis/stasis_main.c28
1 files changed, 26 insertions, 2 deletions
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 {