Skip to content

Commit

Permalink
[KEYCLOAK-19424] - Rename the config command to build
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroigor authored and stianst committed Oct 1, 2021
1 parent 43a3c67 commit 0210aca
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.keycloak.cli;

import static org.keycloak.cli.MainCommand.CONFIG_COMMAND;
import static org.keycloak.cli.MainCommand.BUILD_COMMAND;
import static org.keycloak.cli.MainCommand.START_COMMAND;
import static org.keycloak.cli.MainCommand.isStartDevCommand;
import static org.keycloak.cli.Picocli.createCommandLine;
Expand Down Expand Up @@ -155,7 +155,7 @@ private static boolean requiresReAugmentation(List<String> cliArgs) {

suggestedArgs.removeAll(Arrays.asList("--verbose", "--help"));

System.out.printf("For an optional runtime and bypass this step, please run the 'config' command prior to starting the server:\n\n\t%s config %s\n",
System.out.printf("For an optional runtime and bypass this step, please run the '" + BUILD_COMMAND + "' command prior to starting the server:\n\n\t%s config %s\n",
Environment.getCommand(),
String.join(" ", suggestedArgs) + "\n");

Expand All @@ -172,7 +172,7 @@ private static void runReAugmentation(List<String> cliArgs, CommandLine cmd) {
configArgsList.remove(0);
}

configArgsList.add(0, CONFIG_COMMAND);
configArgsList.add(0, BUILD_COMMAND);

cmd.execute(configArgsList.toArray(new String[0]));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class MainCommand {

static final String START_DEV_COMMAND = "start-dev";
static final String START_COMMAND = "start";
static final String CONFIG_COMMAND = "config";
static final String BUILD_COMMAND = "build";

public static boolean isStartDevCommand(CommandSpec commandSpec) {
return START_DEV_COMMAND.equals(commandSpec.name());
Expand All @@ -78,8 +78,8 @@ public void setConfigFile(String path) {
System.setProperty(KeycloakConfigSourceProvider.KEYCLOAK_CONFIG_FILE_PROP, path);
}

@Command(name = CONFIG_COMMAND,
description = "%nCreates a new server image based on the options passed to this command. Once created, configuration will be read from the server image and the server can be started without passing the same options again. Some configuration options require this command to be executed in order to actually change a configuration. For instance, the database vendor.%n",
@Command(name = BUILD_COMMAND,
description = "%nCreates a new and optimized server image based on the options passed to this command. Once created, configuration will be read from the server image and the server can be started without passing the same options again. Some configuration options require this command to be executed in order to actually change a configuration. For instance, the database vendor.%n",
mixinStandardHelpOptions = true,
usageHelpAutoWidth = true,
optionListHeading = "%nOptions%n",
Expand Down
6 changes: 3 additions & 3 deletions quarkus/runtime/src/main/java/org/keycloak/cli/Picocli.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.keycloak.cli;

import static org.keycloak.cli.MainCommand.CONFIG_COMMAND;
import static org.keycloak.cli.MainCommand.BUILD_COMMAND;
import static org.keycloak.cli.MainCommand.START_COMMAND;
import static org.keycloak.cli.MainCommand.START_DEV_COMMAND;

Expand Down Expand Up @@ -49,10 +49,10 @@ static CommandLine createCommandLine() {

addOption(spec, START_COMMAND, false);
addOption(spec, START_DEV_COMMAND, true);
addOption(spec, CONFIG_COMMAND, true);
addOption(spec, BUILD_COMMAND, true);

for (Profile.Feature feature : Profile.Feature.values()) {
addOption(spec.subcommands().get(CONFIG_COMMAND).getCommandSpec(), "--features-" + feature.name().toLowerCase(),
addOption(spec.subcommands().get(BUILD_COMMAND).getCommandSpec(), "--features-" + feature.name().toLowerCase(),
"Enables the " + feature.name() + " feature. Set enabled to enable the feature or disabled otherwise.");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<bin-chmod/>
<echo>Re-augmenting...</echo>
<exec osfamily="unix" dir="${auth.server.home}/bin" executable="./kc.sh" failonerror="true">
<arg value="config"/>
<arg value="build"/>
<arg value="-Dquarkus.http.root-path=/auth"/>
<arg value="--http-enabled=true"/>
</exec>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private Process startContainer() throws IOException {
}

if (isReaugmentBeforeStart()) {
List<String> commands = new ArrayList<>(Arrays.asList("./kc.sh", "config", "-Dquarkus.http.root-path=/auth", "--http-enabled=true"));
List<String> commands = new ArrayList<>(Arrays.asList("./kc.sh", "build", "-Dquarkus.http.root-path=/auth", "--http-enabled=true"));

addAdditionalCommands(commands);
ProcessBuilder reaugment = new ProcessBuilder(commands);
Expand Down

0 comments on commit 0210aca

Please sign in to comment.