[KEYCLOAK-19424] - Rename the config command to build
This commit is contained in:
parent
43a3c676f7
commit
0210acadad
5 changed files with 11 additions and 11 deletions
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
package org.keycloak.cli;
|
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_COMMAND;
|
||||||
import static org.keycloak.cli.MainCommand.isStartDevCommand;
|
import static org.keycloak.cli.MainCommand.isStartDevCommand;
|
||||||
import static org.keycloak.cli.Picocli.createCommandLine;
|
import static org.keycloak.cli.Picocli.createCommandLine;
|
||||||
|
@ -155,7 +155,7 @@ public class KeycloakMain {
|
||||||
|
|
||||||
suggestedArgs.removeAll(Arrays.asList("--verbose", "--help"));
|
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(),
|
Environment.getCommand(),
|
||||||
String.join(" ", suggestedArgs) + "\n");
|
String.join(" ", suggestedArgs) + "\n");
|
||||||
|
|
||||||
|
@ -172,7 +172,7 @@ public class KeycloakMain {
|
||||||
configArgsList.remove(0);
|
configArgsList.remove(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
configArgsList.add(0, CONFIG_COMMAND);
|
configArgsList.add(0, BUILD_COMMAND);
|
||||||
|
|
||||||
cmd.execute(configArgsList.toArray(new String[0]));
|
cmd.execute(configArgsList.toArray(new String[0]));
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class MainCommand {
|
||||||
|
|
||||||
static final String START_DEV_COMMAND = "start-dev";
|
static final String START_DEV_COMMAND = "start-dev";
|
||||||
static final String START_COMMAND = "start";
|
static final String START_COMMAND = "start";
|
||||||
static final String CONFIG_COMMAND = "config";
|
static final String BUILD_COMMAND = "build";
|
||||||
|
|
||||||
public static boolean isStartDevCommand(CommandSpec commandSpec) {
|
public static boolean isStartDevCommand(CommandSpec commandSpec) {
|
||||||
return START_DEV_COMMAND.equals(commandSpec.name());
|
return START_DEV_COMMAND.equals(commandSpec.name());
|
||||||
|
@ -78,8 +78,8 @@ public class MainCommand {
|
||||||
System.setProperty(KeycloakConfigSourceProvider.KEYCLOAK_CONFIG_FILE_PROP, path);
|
System.setProperty(KeycloakConfigSourceProvider.KEYCLOAK_CONFIG_FILE_PROP, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(name = CONFIG_COMMAND,
|
@Command(name = BUILD_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",
|
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,
|
mixinStandardHelpOptions = true,
|
||||||
usageHelpAutoWidth = true,
|
usageHelpAutoWidth = true,
|
||||||
optionListHeading = "%nOptions%n",
|
optionListHeading = "%nOptions%n",
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
package org.keycloak.cli;
|
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_COMMAND;
|
||||||
import static org.keycloak.cli.MainCommand.START_DEV_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_COMMAND, false);
|
||||||
addOption(spec, START_DEV_COMMAND, true);
|
addOption(spec, START_DEV_COMMAND, true);
|
||||||
addOption(spec, CONFIG_COMMAND, true);
|
addOption(spec, BUILD_COMMAND, true);
|
||||||
|
|
||||||
for (Profile.Feature feature : Profile.Feature.values()) {
|
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.");
|
"Enables the " + feature.name() + " feature. Set enabled to enable the feature or disabled otherwise.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<bin-chmod/>
|
<bin-chmod/>
|
||||||
<echo>Re-augmenting...</echo>
|
<echo>Re-augmenting...</echo>
|
||||||
<exec osfamily="unix" dir="${auth.server.home}/bin" executable="./kc.sh" failonerror="true">
|
<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="-Dquarkus.http.root-path=/auth"/>
|
||||||
<arg value="--http-enabled=true"/>
|
<arg value="--http-enabled=true"/>
|
||||||
</exec>
|
</exec>
|
||||||
|
|
|
@ -146,7 +146,7 @@ public class KeycloakQuarkusServerDeployableContainer implements DeployableConta
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isReaugmentBeforeStart()) {
|
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);
|
addAdditionalCommands(commands);
|
||||||
ProcessBuilder reaugment = new ProcessBuilder(commands);
|
ProcessBuilder reaugment = new ProcessBuilder(commands);
|
||||||
|
|
Loading…
Reference in a new issue