[KEYCLOAK-19424] - Rename the config command to build

This commit is contained in:
Pedro Igor 2021-09-30 11:32:48 -03:00 committed by Stian Thorgersen
parent 43a3c676f7
commit 0210acadad
5 changed files with 11 additions and 11 deletions

View file

@ -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;
@ -155,7 +155,7 @@ public class KeycloakMain {
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");
@ -172,7 +172,7 @@ public class KeycloakMain {
configArgsList.remove(0);
}
configArgsList.add(0, CONFIG_COMMAND);
configArgsList.add(0, BUILD_COMMAND);
cmd.execute(configArgsList.toArray(new String[0]));

View file

@ -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());
@ -78,8 +78,8 @@ public class MainCommand {
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",

View file

@ -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;
@ -49,10 +49,10 @@ final class Picocli {
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.");
}

View file

@ -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>

View file

@ -146,7 +146,7 @@ public class KeycloakQuarkusServerDeployableContainer implements DeployableConta
}
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);