diff --git a/cli/src/main/java/org/wildfly/glow/cli/commands/Constants.java b/cli/src/main/java/org/wildfly/glow/cli/commands/Constants.java index 5929a2ce..cbb46e00 100644 --- a/cli/src/main/java/org/wildfly/glow/cli/commands/Constants.java +++ b/cli/src/main/java/org/wildfly/glow/cli/commands/Constants.java @@ -22,29 +22,27 @@ */ public interface Constants { - String HA = "ha"; - - String COMPLETION_COMMAND = "completion"; - String GO_OFFLINE_COMMAND = "go-offline"; - String SCAN_COMMAND = "scan"; - String SHOW_ADD_ONS_COMMAND = "show-add-ons"; - String SHOW_CONFIGURATION_COMMAND = "show-configuration"; - String SHOW_SERVER_VERSIONS_COMMAND = "show-server-versions"; - String ADD_LAYERS_FOR_JNDI_OPTION = "--add-layers-for-jndi"; - String ADD_LAYERS_FOR_JNDI_OPTION_LABEL = ""; String ADD_ONS_OPTION = "--add-ons"; String ADD_ONS_OPTION_LABEL = ""; String ADD_ONS_OPTION_SHORT = "-ao"; - + String ADD_LAYERS_FOR_JNDI_OPTION = "--add-layers-for-jndi"; + String ADD_LAYERS_FOR_JNDI_OPTION_LABEL = ""; String BATCH_OPTION = "--batch"; String BATCH_OPTION_SHORT = "-B"; - String BUILD_ENV_FILE_OPTION = "--build-env-file"; String BUILD_ENV_FILE_OPTION_SHORT = "-bef"; String BUILD_ENV_FILE_OPTION_LABEL = ""; - + String CHANNELS_OPTION = "--channels"; + String CHANNELS_OPTION_SHORT = "-cc"; + String CHANNELS_OPTION_LABEL = ""; + String CLI_SCRIPT_OPTION = "--cli-script"; + String CLI_SCRIPT_OPTION_SHORT = "-cs"; + String CLI_SCRIPT_OPTION_LABEL = ""; String CLOUD_OPTION = "--cloud"; String CLOUD_OPTION_SHORT = "-c"; + String COMPLETION_COMMAND = "completion"; + String CONFIG_STABILITY_OPTION = "--config-stability-level"; + String CONFIG_STABILITY_OPTION_SHORT = "-csl"; String DISABLE_DEPLOYERS = "--disable-deployers"; String DISABLE_DEPLOYERS_LABEL = ""; String DOCKER_IMAGE_NAME_OPTION = "--docker-image-name"; @@ -59,15 +57,10 @@ public interface Constants { String FAILS_ON_ERROR_OPTION = "--fails-on-error"; String FAILS_ON_ERROR_OPTION_SHORT = "-foe"; String HA_OPTION = "--ha"; - + String GO_OFFLINE_COMMAND = "go-offline"; + String HA = "ha"; String HELP_OPTION = "--help"; String HELP_OPTION_SHORT = "-h"; - String CHANNELS_FILE_OPTION = "--channels-file"; - String CHANNELS_FILE_OPTION_SHORT = "-cf"; - String CHANNELS_FILE_OPTION_LABEL = ""; - String CLI_SCRIPT_OPTION = "--cli-script"; - String CLI_SCRIPT_OPTION_SHORT = "-cs"; - String CLI_SCRIPT_OPTION_LABEL = ""; String INIT_SCRIPT_OPTION = "--init-script"; String INIT_SCRIPT_OPTION_SHORT = "-is"; String INIT_SCRIPT_OPTION_LABEL = ""; @@ -75,43 +68,34 @@ public interface Constants { String INPUT_FEATURE_PACKS_FILE_OPTION_LABEL = ""; String NO_DOCKER_IMAGE_OPTION = "--no-docker-image"; String NO_DOCKER_IMAGE_OPTION_SHORT = "-nd"; + String PACKAGE_STABILITY_OPTION = "--package-stability-level"; + String PACKAGE_STABILITY_OPTION_SHORT = "-psl"; String PROVISION_OPTION = "--provision"; String PROVISION_OPTION_LABEL = ""; String PROVISION_OPTION_SHORT = "-p"; + String PROVISION_OUTPUT_DIR_OPTION = "--output-dir"; + String PROVISION_OUTPUT_DIR_OPTION_SHORT = "-d"; + String PROVISION_OUTPUT_DIR_LABEL = ""; + String SCAN_COMMAND = "scan"; String SERVER_VERSION_OPTION = "--server-version"; String SERVER_VERSION_OPTION_SHORT = "-sv"; String SERVER_VERSION_OPTION_LABEL = ""; + String SHOW_ADD_ONS_COMMAND = "show-add-ons"; + String SHOW_CONFIGURATION_COMMAND = "show-configuration"; + String SHOW_SERVER_VERSIONS_COMMAND = "show-server-versions"; + String STABILITY_LABEL = ""; + String STABILITY_OPTION = "--stability-level"; + String STABILITY_OPTION_SHORT = "-sl"; String SYSTEM_PROPERTIES_LABEL = "\"<-DpropName[=value] [-DpropName[=value]]>\""; String SYSTEM_PROPERTIES_OPTION = "--properties"; String SYSTEM_PROPERTIES_OPTION_SHORT = "-pp"; String SUGGEST_OPTION = "--suggest"; String SUGGEST_OPTION_SHORT = "-s"; - String VERBOSE_OPTION = "--verbose"; String VERBOSE_OPTION_SHORT = "-vv"; - String VERSION_OPTION = "--version"; String VERSION_OPTION_SHORT = "-v"; - + String WILDFLY_GLOW = "wildfly-glow"; String WILDFLY_PREVIEW_OPTION = "--wildfly-preview"; String WILDFLY_PREVIEW_OPTION_SHORT = "-wp"; - - String WILDFLY_GLOW = "wildfly-glow"; - - String PROVISION_OUTPUT_DIR_OPTION = "--output-dir"; - - String PROVISION_OUTPUT_DIR_OPTION_SHORT = "-d"; - - String PROVISION_OUTPUT_DIR_LABEL = ""; - - String STABILITY_OPTION = "--stability-level"; - String STABILITY_OPTION_SHORT = "-sl"; - - String PACKAGE_STABILITY_OPTION = "--package-stability-level"; - String PACKAGE_STABILITY_OPTION_SHORT = "-psl"; - - String CONFIG_STABILITY_OPTION = "--config-stability-level"; - String CONFIG_STABILITY_OPTION_SHORT = "-csl"; - - String STABILITY_LABEL = ""; } diff --git a/cli/src/main/java/org/wildfly/glow/cli/commands/ScanCommand.java b/cli/src/main/java/org/wildfly/glow/cli/commands/ScanCommand.java index 90e58be7..4da96ea1 100644 --- a/cli/src/main/java/org/wildfly/glow/cli/commands/ScanCommand.java +++ b/cli/src/main/java/org/wildfly/glow/cli/commands/ScanCommand.java @@ -153,7 +153,7 @@ public OutputFormat convert(String value) throws Exception { @CommandLine.Option(names = {Constants.FAILS_ON_ERROR_OPTION_SHORT, Constants.FAILS_ON_ERROR_OPTION}, defaultValue = "true") Optional failsOnError; - @CommandLine.Option(names = {Constants.CHANNELS_FILE_OPTION_SHORT, Constants.CHANNELS_FILE_OPTION}, paramLabel = Constants.CHANNELS_FILE_OPTION_LABEL) + @CommandLine.Option(names = {Constants.CHANNELS_OPTION_SHORT, Constants.CHANNELS_OPTION}, paramLabel = Constants.CHANNELS_OPTION_LABEL) Optional channelsFile; @Override @@ -195,13 +195,13 @@ public Integer call() throws Exception { } if (wildflyPreview.orElse(false)) { if (channelsFile.isPresent()) { - throw new Exception(Constants.WILDFLY_PREVIEW_OPTION + "can't be set when " + Constants.CHANNELS_FILE_OPTION + " is set."); + throw new Exception(Constants.WILDFLY_PREVIEW_OPTION + "can't be set when " + Constants.CHANNELS_OPTION + " is set."); } builder.setTechPreview(true); } if (wildflyServerVersion.isPresent()) { if (channelsFile.isPresent()) { - throw new Exception(Constants.SERVER_VERSION_OPTION + "can't be set when " + Constants.CHANNELS_FILE_OPTION + " is set."); + throw new Exception(Constants.SERVER_VERSION_OPTION + "can't be set when " + Constants.CHANNELS_OPTION + " is set."); } builder.setVersion(wildflyServerVersion.get()); } diff --git a/cli/src/main/java/org/wildfly/glow/cli/commands/ShowAddOnsCommand.java b/cli/src/main/java/org/wildfly/glow/cli/commands/ShowAddOnsCommand.java index 2027c946..c57fdbb2 100644 --- a/cli/src/main/java/org/wildfly/glow/cli/commands/ShowAddOnsCommand.java +++ b/cli/src/main/java/org/wildfly/glow/cli/commands/ShowAddOnsCommand.java @@ -49,7 +49,7 @@ public class ShowAddOnsCommand extends AbstractCommand { @CommandLine.Option(names = Constants.INPUT_FEATURE_PACKS_FILE_OPTION, paramLabel = Constants.INPUT_FEATURE_PACKS_FILE_OPTION_LABEL) Optional provisioningXml; - @CommandLine.Option(names = {Constants.CHANNELS_FILE_OPTION_SHORT, Constants.CHANNELS_FILE_OPTION}, paramLabel = Constants.CHANNELS_FILE_OPTION_LABEL) + @CommandLine.Option(names = {Constants.CHANNELS_OPTION_SHORT, Constants.CHANNELS_OPTION}, paramLabel = Constants.CHANNELS_OPTION_LABEL) Optional channelsFile; @Override @@ -61,12 +61,12 @@ public Integer call() throws Exception { } if (wildflyPreview.orElse(false)) { if (channelsFile.isPresent()) { - throw new Exception(Constants.WILDFLY_PREVIEW_OPTION + "can't be set when " + Constants.CHANNELS_FILE_OPTION + " is set."); + throw new Exception(Constants.WILDFLY_PREVIEW_OPTION + "can't be set when " + Constants.CHANNELS_OPTION + " is set."); } } if (wildflyServerVersion.isPresent()) { if (channelsFile.isPresent()) { - throw new Exception(Constants.SERVER_VERSION_OPTION + "can't be set when " + Constants.CHANNELS_FILE_OPTION + " is set."); + throw new Exception(Constants.SERVER_VERSION_OPTION + "can't be set when " + Constants.CHANNELS_OPTION + " is set."); } } ProvisioningUtils.ProvisioningConsumer consumer = new ProvisioningConsumer() { diff --git a/cli/src/main/java/org/wildfly/glow/cli/commands/ShowConfigurationCommand.java b/cli/src/main/java/org/wildfly/glow/cli/commands/ShowConfigurationCommand.java index 88673a94..06dbea1c 100644 --- a/cli/src/main/java/org/wildfly/glow/cli/commands/ShowConfigurationCommand.java +++ b/cli/src/main/java/org/wildfly/glow/cli/commands/ShowConfigurationCommand.java @@ -57,7 +57,7 @@ public class ShowConfigurationCommand extends AbstractCommand { @CommandLine.Option(names = Constants.INPUT_FEATURE_PACKS_FILE_OPTION, paramLabel = Constants.INPUT_FEATURE_PACKS_FILE_OPTION_LABEL) Optional provisioningXml; - @CommandLine.Option(names = {Constants.CHANNELS_FILE_OPTION_SHORT, Constants.CHANNELS_FILE_OPTION}, paramLabel = Constants.CHANNELS_FILE_OPTION_LABEL) + @CommandLine.Option(names = {Constants.CHANNELS_OPTION_SHORT, Constants.CHANNELS_OPTION}, paramLabel = Constants.CHANNELS_OPTION_LABEL) Optional channelsFile; @Override @@ -76,12 +76,12 @@ public Integer call() throws Exception { } if (wildflyPreview.orElse(false)) { if (channelsFile.isPresent()) { - throw new Exception(Constants.WILDFLY_PREVIEW_OPTION + "can't be set when " + Constants.CHANNELS_FILE_OPTION + " is set."); + throw new Exception(Constants.WILDFLY_PREVIEW_OPTION + "can't be set when " + Constants.CHANNELS_OPTION + " is set."); } } if (wildflyServerVersion.isPresent()) { if (channelsFile.isPresent()) { - throw new Exception(Constants.SERVER_VERSION_OPTION + "can't be set when " + Constants.CHANNELS_FILE_OPTION + " is set."); + throw new Exception(Constants.SERVER_VERSION_OPTION + "can't be set when " + Constants.CHANNELS_OPTION + " is set."); } } String finalContext = context; diff --git a/cli/src/main/resources/UsageMessages.properties b/cli/src/main/resources/UsageMessages.properties index 7e1196c3..9ba06f95 100644 --- a/cli/src/main/resources/UsageMessages.properties +++ b/cli/src/main/resources/UsageMessages.properties @@ -3,59 +3,51 @@ # # # Main Command Welcome Message -# -# This is only printed when running prospero without any parameters. +# This is only printed when running wildfl-glow without any parameters. glow.welcomeMessage = @|bold \nWelcome to WildFly Glow CLI!|@\n\ \n\ WildFly Glow helps you create a WildFly server based on the content of your WAR/JAR/EAR deployment(s).\n\ Call @|fg(yellow) wildfly-glow scan |@ to get started.\n -# -# Footer -# -# This only appears in the main command usage. - -wildfly-glow.usage.footer = %nUse @|fg(yellow) wildfly-glow --help|@ to show help information for the command. - +add-layers-for-jndi = List of layers. In the case some layers are missing, consider adding them manually with this option. +add-ons = List of add-ons to enable. To get the list of possible add-ons, use the @|fg(yellow) show-add-ons|@ command. batch = Batch mode disables any colorization of the output. +build-env-file = The path to a file that contains environment variables (in the form env=value) to be passed to the OpenShift build. Can only be used with @|fg(yellow) OPENSHIFT|@ kind of provisioning. +channels= Path to a yaml file containing one or more channels. +cli-script = The path to a CLI script file that only contains CLI commands in order to fine tune the server on OpenShift deployment. Can only be used with @|fg(yellow) OPENSHIFT|@ kind of provisioning. cloud = When deploying your application to the cloud. It will fine tune the WildFly server for the cloud. N.B.: Building a Bootable JAR is not supported for the cloud. -exclude-archives-from-scan = Comma-separated list of archives to exclude from scanning. Wildcards ('*') are allowed. N.B. Just the name of the archive is matched, do not attempt to specify a full path within the jar. The following example would be a valid list: @|fg(italic) my-jar.jar,*-internal.rar|@: +config-stability-level = Specify a stability to be used when provisioning the server configuration. The stability is also used to identify server features that would be not enabled by the specified stability. The stability is by default the minimum stability of each Galleon feature-packs. The stability can be @|fg(yellow) default|@, @|fg(yellow) community|@, @|fg(yellow) preview|@, @|fg(yellow) experimental|@. +deployments = List of path to war|jar|ear files to scan. +disable-deployers = A comma separated list of deployer names to disable. To retrieve all the deployer names call the @|fg(yellow) show-configuration|@ operation. To disable them all, use @|fg(yellow) ALL|@ value. Can only be used with @|fg(yellow) OPENSHIFT|@ kind of provisioning. docker-image-name = Name of the docker image when --provision=DOCKER is specified. By default an image name is computed based on the WildFly server version. -version = Prints the version of wildfly-glow and exits. -verbose = Prints additional information. When scanning a deployment, the set of rules that selected a Galleon layer are printed. Enable verbose if the command fails in order to get details. -server-version = The WildFly server version to deploy the deployment to. By default the latest WildFly version is used. -wildfly-preview = To deploy the deployment into a WildFly preview server (by default normal WildFly server is used). +env-file = The path to a file that contains environment variables (in the form env=value) to be passed to the OpenShift deployment. Can only be used with @|fg(yellow) OPENSHIFT|@ kind of provisioning. +exclude-archives-from-scan = Comma-separated list of archives to exclude from scanning. Wildcards ('*') are allowed. N.B. Just the name of the archive is matched, do not attempt to specify a full path within the jar. The following example would be a valid list: @|fg(italic) my-jar.jar,*-internal.rar|@: +fails-on-error= By default provisioning will be aborted if an error is reported by WildFly Glow. Set this option to false to not fail and process with the provisioning. ha = High Availability profile. Set this option when deploying an application into an HA WildFly Server. -add-layers-for-jndi = List of layers. In the case some layers are missing, consider adding them manually with this option. -suggest = WildFly Glow will suggest additional add-ons and environment variables that are usable with your deployment. -add-ons = List of add-ons to enable. To get the list of possible add-ons, use the @|fg(yellow) show-add-ons|@ command. -deployments = List of path to war|jar|ear files to scan. +init-script = The path to a script that contains commands (JBoss CLI, add-user, ...) to fine tune the server on OpenShift deployment. Can only be used with @|fg(yellow) OPENSHIFT|@ kind of provisioning. input-feature-packs-file = Galleon feature-packs used by wildfly-glow are retrieved from an online registry. To override the set of feature-packs you can specify a path to a Galleon provisioning XML file containing the set of Galleon feature-packs to be used by wildfly-glow. -provision = The kind of provisioning to produce based on what has been discovered. Can be @|fg(yellow) SERVER|@: a provisioned WildFly server, @|fg(yellow) BOOTABLE_JAR|@: a WildFly Bootable JAR, @|fg(yellow) DOCKER_IMAGE|@: a Docker image, @|fg(yellow) OPENSHIFT|@: a server built and deploy on OpenShift, you must be logged to a cluster, or @|fg(yellow) PROVISIONING_XML|@: a Galleon provisioning.xml file. output-dir = If specifying to provision, the directory where the result will be output. -wildfly-preview = Use only WildFly preview feature-packs as input. -stability-level = Specify a stability to be used when provisioning a server. This is an option to set both config-stability-level and package-stability-level options with a single option. The stability is also used to identify server features and packages that would be not enabled by the specified stability. The stability is by default the minimum stability of each Galleon feature-packs. The stability can be @|fg(yellow) default|@, @|fg(yellow) community|@, @|fg(yellow) preview|@, @|fg(yellow) experimental|@. -config-stability-level = Specify a stability to be used when provisioning the server configuration. The stability is also used to identify server features that would be not enabled by the specified stability. The stability is by default the minimum stability of each Galleon feature-packs. The stability can be @|fg(yellow) default|@, @|fg(yellow) community|@, @|fg(yellow) preview|@, @|fg(yellow) experimental|@. package-stability-level = Specify a stability to be used when provisioning server packages. The stability is also used to identify server packages that would be not provisioned by the specified stability. The stability is by default the minimum stability of each Galleon feature-packs. The stability can be @|fg(yellow) default|@, @|fg(yellow) community|@, @|fg(yellow) preview|@, @|fg(yellow) experimental|@. -env-file = The path to a file that contains environment variables (in the form env=value) to be passed to the OpenShift deployment. Can only be used with @|fg(yellow) OPENSHIFT|@ kind of provisioning. -build-env-file = The path to a file that contains environment variables (in the form env=value) to be passed to the OpenShift build. Can only be used with @|fg(yellow) OPENSHIFT|@ kind of provisioning. -init-script = The path to a script that contains commands (JBoss CLI, add-user, ...) to fine tune the server on OpenShift deployment. Can only be used with @|fg(yellow) OPENSHIFT|@ kind of provisioning. -cli-script = The path to a CLI script file that only contains CLI commands in order to fine tune the server on OpenShift deployment. Can only be used with @|fg(yellow) OPENSHIFT|@ kind of provisioning. -channels-file= Path to a yaml file containing one or more channels. -disable-deployers = A comma separated list of deployer names to disable. To retrieve all the deployer names call the @|fg(yellow) show-configuration|@ operation. To disable them all, use @|fg(yellow) ALL|@ value. Can only be used with @|fg(yellow) OPENSHIFT|@ kind of provisioning. properties = A space separated list of Java system properties. When multiple system properties are set, the list must be enclosed in double quotes. For example: "-Dfoo=bar -DmyProp" -fails-on-error= By default provisioning will be aborted if an error is reported by WildFly Glow. Set this option to false to not fail and process with the provisioning. -usage.synopsisHeading = %nUsage:\u0020 -# for the main command do not prepend with new line character: -wildfly-glow.usage.synopsisHeading = Usage:\u0020 +provision = The kind of provisioning to produce based on what has been discovered. Can be @|fg(yellow) SERVER|@: a provisioned WildFly server, @|fg(yellow) BOOTABLE_JAR|@: a WildFly Bootable JAR, @|fg(yellow) DOCKER_IMAGE|@: a Docker image, @|fg(yellow) OPENSHIFT|@: a server built and deploy on OpenShift, you must be logged to a cluster, or @|fg(yellow) PROVISIONING_XML|@: a Galleon provisioning.xml file. +server-version = The WildFly server version to deploy the deployment to. By default the latest WildFly version is used. +stability-level = Specify a stability to be used when provisioning a server. This is an option to set both config-stability-level and package-stability-level options with a single option. The stability is also used to identify server features and packages that would be not enabled by the specified stability. The stability is by default the minimum stability of each Galleon feature-packs. The stability can be @|fg(yellow) default|@, @|fg(yellow) community|@, @|fg(yellow) preview|@, @|fg(yellow) experimental|@. +suggest = WildFly Glow will suggest additional add-ons and environment variables that are usable with your deployment. usage.commandListHeading = %nCommands:%n usage.optionListHeading = %nOptions:%n +usage.synopsisHeading = %nUsage:\u0020 +verbose = Prints additional information. When scanning a deployment, the set of rules that selected a Galleon layer are printed. Enable verbose if the command fails in order to get details. +version = Prints the version of wildfly-glow and exits. +wildfly-glow.completion.usage.header = Generates a bash completion script. To enable auto-completion, use the command `source <(./wildfly-glow completion)`. wildfly-glow.help = Displays the help information for the command. - - +wildfly-glow.go-offline.usage.header = Generate a zip file containing all that is required to run the tool in offline mode. Put the generated zip in the working directory of WildFly Glow to work offline. +wildfly-glow.scan.usage.header = Scan your deployment(s) to produce a WildFly server. +wildfly-glow.show-add-ons.usage.header = Shows all the WildFly server add-ons one can set with the @|fg(yellow) --add-ons|@ option to the @|fg(yellow) scan|@ command. wildfly-glow.show-configuration.usage.header = Shows the Galleon feature-packs and Galleon layers known by WildFly Glow. wildfly-glow.show-server-versions.usage.header = Shows all WildFly server versions one can set with the @|fg(yellow) --server-version|@ option. -wildfly-glow.show-add-ons.usage.header = Shows all the WildFly server add-ons one can set with the @|fg(yellow) --add-ons|@ option to the @|fg(yellow) scan|@ command. -wildfly-glow.scan.usage.header = Scan your deployment(s) to produce a WildFly server. -wildfly-glow.go-offline.usage.header = Generate a zip file containing all that is required to run the tool in offline mode. Put the generated zip in the working directory of WildFly Glow to work offline. -wildfly-glow.completion.usage.header = Generates a bash completion script. To enable auto-completion, use the command `source <(./wildfly-glow completion)`. \ No newline at end of file +# Footer +# This only appears in the main command usage. +wildfly-glow.usage.footer = %nUse @|fg(yellow) wildfly-glow --help|@ to show help information for the command. +# for the main command do not prepend with new line character: +wildfly-glow.usage.synopsisHeading = Usage:\u0020 +wildfly-preview = To deploy the deployment into a WildFly preview server (by default normal WildFly server is used).