use of io.quarkus.dev.console.TempSystemProperties in project quarkus by quarkusio.
the class RebuildHandler method handlePostAsync.
@Override
protected void handlePostAsync(RoutingContext event, MultiMap form) throws Exception {
QuarkusBootstrap existing = (QuarkusBootstrap) DevConsoleManager.getQuarkusBootstrap();
try (TempSystemProperties properties = new TempSystemProperties()) {
for (Map.Entry<String, String> i : config.entrySet()) {
properties.set(i.getKey(), i.getValue());
}
for (Map.Entry<String, String> i : form.entries()) {
if (!i.getValue().isEmpty()) {
properties.set(i.getKey(), i.getValue());
}
}
QuarkusBootstrap quarkusBootstrap = existing.clonedBuilder().setMode(QuarkusBootstrap.Mode.PROD).setIsolateDeployment(true).build();
try (CuratedApplication bootstrap = quarkusBootstrap.bootstrap()) {
AugmentResult augmentResult = bootstrap.createAugmentor().createProductionApplication();
List<ArtifactResult> containerArtifactResults = augmentResult.resultsMatchingType((s) -> s.contains("container"));
if (containerArtifactResults.size() >= 1) {
flashMessage(event, "Container-image: " + containerArtifactResults.get(0).getMetadata().get("container-image") + " created.", Duration.ofSeconds(10));
}
}
}
;
}
Aggregations