Better separate staging environment [stage]

This commit is contained in:
crschnick
2023-04-26 14:34:59 +00:00
parent 1e10c595e4
commit a458f6ffe5
5 changed files with 39 additions and 2 deletions

View File

@@ -74,6 +74,7 @@ public class App extends Application {
() -> {
var base = String.format(
"X-Pipe Desktop (%s)", AppProperties.get().getVersion());
var prefix = AppProperties.get().isStaging() ? "[STAGE] " : "";
var suffix = XPipeDistributionType.get().getUpdateHandler().getPreparedUpdate().getValue() != null
? String.format(
" (Update to %s ready)",
@@ -82,7 +83,7 @@ public class App extends Application {
.getValue()
.getVersion())
: "";
return base + suffix;
return prefix + base + suffix;
},
XPipeDistributionType.get().getUpdateHandler().getPreparedUpdate());

View File

@@ -25,6 +25,7 @@ public class AppProperties {
UUID buildUuid;
String sentryUrl;
boolean image;
boolean staging;
Path dataDir;
public AppProperties() {
@@ -51,6 +52,9 @@ public class AppProperties {
.orElse(UUID.randomUUID());
sentryUrl = System.getProperty("io.xpipe.app.sentryUrl");
dataDir = parseDataDir();
staging = Optional.ofNullable(System.getProperty("io.xpipe.app.staging"))
.map(Boolean::parseBoolean)
.orElse(false);
}
public static void logSystemProperties() {

View File

@@ -33,7 +33,7 @@ public class AppDownloads {
.withRateLimitHandler(RateLimitHandler.FAIL)
.withAuthorizationProvider(AuthorizationProvider.ANONYMOUS)
.build();
repository = github.getRepository("xpipe-io/xpipe");
repository = github.getRepository(AppProperties.get().isStaging() ? "xpipe-io/xpipe_staging" : "xpipe-io/xpipe");
return repository;
}