Skip to content

Commit

Permalink
provision value is no more case sensitive. Openshift env var are disp…
Browse files Browse the repository at this point in the history
…layed sooner
  • Loading branch information
Jean Francois Denise committed Apr 4, 2024
1 parent 61a4ec6 commit 47f4cfa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ public Stability convert(String value) throws Exception {
return Stability.fromString(value);
}
}
private static class ProvisionConverter implements CommandLine.ITypeConverter<OutputFormat> {

@Override
public OutputFormat convert(String value) throws Exception {
return OutputFormat.valueOf(value.toUpperCase());
}
}

private static final String ADD_ADD_ONS_MSG = "@|bold To enable add-ons, add the|@ @|fg(yellow) "
+ Constants.ADD_ONS_OPTION + "=<list of add-ons>|@ @|bold option to the|@ @|fg(yellow) "
Expand Down Expand Up @@ -103,7 +110,7 @@ public Stability convert(String value) throws Exception {
@CommandLine.Option(names = Constants.INPUT_FEATURE_PACKS_FILE_OPTION, paramLabel = Constants.INPUT_FEATURE_PACKS_FILE_OPTION_LABEL)
Optional<Path> provisioningXml;

@CommandLine.Option(names = {Constants.PROVISION_OPTION_SHORT, Constants.PROVISION_OPTION}, paramLabel = Constants.PROVISION_OPTION_LABEL)
@CommandLine.Option(converter = ProvisionConverter.class, names = {Constants.PROVISION_OPTION_SHORT, Constants.PROVISION_OPTION}, paramLabel = Constants.PROVISION_OPTION_LABEL)
Optional<OutputFormat> provision;

@CommandLine.Option(names = {Constants.PROVISION_OUTPUT_DIR_OPTION_SHORT, Constants.PROVISION_OUTPUT_DIR_OPTION}, paramLabel = Constants.PROVISION_OUTPUT_DIR_LABEL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,23 +286,20 @@ public static void deploy(GlowMessageWriter writer,
}
}
writer.info("\nThe active deployers have resolved the environment variables required at build time and deployment time.");

actualEnv.put("APPLICATION_ROUTE_HOST", host);
actualEnv.putAll(extraEnv);
if (!disabledDeployers.isEmpty()) {
writer.warn("\nThe following environment variables will be set in the " + appName + " deployment. Make sure that the required env variables for the disabled deployer(s) have been set:\n");
} else {
writer.warn("\nThe following environment variables will be set in the " + appName + " deployment:\n");
}
for (Entry<String, String> entry : actualEnv.entrySet()) {
writer.warn(entry.getKey() + "=" + entry.getValue());
}
// Can be overriden by user
actualBuildEnv.putAll(buildExtraEnv);
createBuild(writer, target, osClient, appName, initScript, cliScript, actualBuildEnv, config);
actualEnv.put("APPLICATION_ROUTE_HOST", host);
actualEnv.putAll(extraEnv);
writer.info("Deploying application image on OpenShift");
if (!actualEnv.isEmpty()) {
if (!disabledDeployers.isEmpty()) {
writer.warn("\nThe following environment variables have been set in the " + appName + " deployment. Make sure that the required env variables for the disabled deployer(s) have been set:\n");
} else {
writer.warn("\nThe following environment variables have been set in the " + appName + " deployment:\n");
}
for (Entry<String, String> entry : actualEnv.entrySet()) {
writer.warn(entry.getKey() + "=" + entry.getValue());
}
}
createAppDeployment(writer, target, osClient, appName, actualEnv, ha);
writer.info("\nApplication route: https://" + host + ("ROOT.war".equals(appName) ? "" : "/" + appName));
}
Expand Down

0 comments on commit 47f4cfa

Please sign in to comment.