Skip to content

Commit

Permalink
Disable DevUI for remote dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Mar 9, 2021
1 parent 345bf2a commit 2dd118d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ private BuildResult runAugment(boolean firstRun, Set<String> changedResources,
}

builder.setLaunchMode(launchMode);
builder.setDevModeType(devModeType);
builder.setRebuild(quarkusBootstrap.isRebuild());
if (firstRun) {
builder.setLiveReloadState(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import io.quarkus.deployment.util.ArtifactInfoUtil;
import io.quarkus.deployment.util.WebJarUtil;
import io.quarkus.dev.console.DevConsoleManager;
import io.quarkus.dev.spi.DevModeType;
import io.quarkus.devconsole.spi.DevConsoleRouteBuildItem;
import io.quarkus.devconsole.spi.DevConsoleRuntimeTemplateInfoBuildItem;
import io.quarkus.devconsole.spi.DevConsoleTemplateInfoBuildItem;
Expand Down Expand Up @@ -280,7 +281,11 @@ public void setupActions(List<DevConsoleRouteBuildItem> routes,
LogStreamRecorder recorder,
CurateOutcomeBuildItem curateOutcomeBuildItem,
HistoryHandlerBuildItem historyHandlerBuildItem,
NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem) {
NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem,
LaunchModeBuildItem launchModeBuildItem) {
if (launchModeBuildItem.getDevModeType().orElse(null) != DevModeType.LOCAL) {
return;
}
initializeVirtual();

newRouter(buildEngine(devTemplatePaths), nonApplicationRootPathBuildItem);
Expand Down Expand Up @@ -326,7 +331,12 @@ public void setupActions(List<DevConsoleRouteBuildItem> routes,
public void deployStaticResources(DevConsoleRecorder recorder, CurateOutcomeBuildItem curateOutcomeBuildItem,
LaunchModeBuildItem launchMode, ShutdownContextBuildItem shutdownContext,
BuildProducer<RouteBuildItem> routeBuildItemBuildProducer,
NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem) throws IOException {
NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem,
LaunchModeBuildItem launchModeBuildItem) throws IOException {

if (launchModeBuildItem.getDevModeType().orElse(DevModeType.LOCAL) != DevModeType.LOCAL) {
return;
}
AppArtifact devConsoleResourcesArtifact = WebJarUtil.getAppArtifact(curateOutcomeBuildItem, "io.quarkus",
"quarkus-vertx-http-deployment");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public void testThatTheApplicationIsReloadedOnJavaChange()
await()
.pollDelay(1, TimeUnit.SECONDS)
.atMost(1, TimeUnit.MINUTES).until(() -> DevModeTestUtils.getHttpResponse("/app/hello").contains("carambar"));

//also verify that the dev ui console is disabled
DevModeTestUtils.getHttpResponse("/q/dev", 404, 10, TimeUnit.SECONDS);
}

@Test
Expand Down

0 comments on commit 2dd118d

Please sign in to comment.