Skip to content

Commit

Permalink
fixes #638 remove most config files and use values.yml to overwrite (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehu authored Nov 6, 2022
1 parent 391e3c0 commit 9c998fe
Show file tree
Hide file tree
Showing 23 changed files with 94 additions and 847 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ public void generate(final String targetPath, Object model, JsonNode config) thr
}
transfer(targetPath, "proxy", "server.yml", templates.lambda.proxy.server.template(serviceId, enableRegistry, version));

transfer(targetPath, "proxy", "openapi-security.yml", templates.rest.openapiSecurity.template());
transfer(targetPath, "proxy", "openapi-validator.yml", templates.rest.openapiValidator.template());
transfer(targetPath, "proxy", "client.yml", templates.rest.clientYml.template());

transfer(targetPath, "proxy", "primary.crt", templates.rest.primaryCrt.template());
transfer(targetPath, "proxy", "secondary.crt", templates.rest.secondaryCrt.template());
// transfer binary files without touching them.
Expand All @@ -148,18 +144,8 @@ public void generate(final String targetPath, Object model, JsonNode config) thr
transfer(targetPath, "proxy", "proxy.yml", templates.lambda.proxy.proxy.template());

// exclusion list for Config module
transfer(targetPath, "proxy", "config.yml", templates.rest.config.template(config));

transfer(targetPath, "proxy", "audit.yml", templates.rest.auditYml.template());
transfer(targetPath, "proxy", "body.yml", templates.rest.bodyYml.template());
transfer(targetPath, "proxy", "info.yml", templates.rest.infoYml.template());
transfer(targetPath, "proxy", "correlation.yml", templates.rest.correlationYml.template());
transfer(targetPath, "proxy", "metrics.yml", templates.rest.metricsYml.template());
transfer(targetPath, "proxy", "sanitizer.yml", templates.rest.sanitizerYml.template());
transfer(targetPath, "proxy", "traceability.yml", templates.rest.traceabilityYml.template());
transfer(targetPath, "proxy", "health.yml", templates.rest.healthYml.template());
// values.yml file, transfer to suppress the warning message during start startup and encourage usage.
transfer(targetPath, "proxy", "values.yml", templates.rest.values.template());
transfer(targetPath, "proxy", "values.yml", templates.rest.values.template(serviceId, enableHttp, httpPort, enableHttps, httpsPort, enableHttp2, enableRegistry, version, config));
// buildSh.rocker.raw for the docker image build
transfer(targetPath, "", "build.sh", templates.lambda.buildSh.template());
// Dockerfile for the proxy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,21 +147,6 @@ public void generate(final String targetPath, Object model, JsonNode config) thr
transfer(targetPath, "", ".project", templates.rest.project.template(config));
}
// config
transfer(targetPath, (configFolder).replace(".", separator), "service.yml", templates.rest.serviceYml.template(config));

transfer(targetPath, (configFolder).replace(".", separator), "server.yml",
templates.rest.serverYml.template(serviceId, enableHttp, httpPort, enableHttps, httpsPort, enableHttp2, enableRegistry, version));
transfer(targetPath, (testConfigFolder).replace(".", separator), "server.yml",
templates.rest.serverYml.template(serviceId, enableHttp, "49587", enableHttps, "49588", enableHttp2, enableRegistry, version));

transfer(targetPath, (configFolder).replace(".", separator), "openapi-security.yml", templates.rest.openapiSecurity.template());
transfer(targetPath, (configFolder).replace(".", separator), "openapi-validator.yml", templates.rest.openapiValidator.template());
if (supportClient) {
transfer(targetPath, (configFolder).replace(".", separator), "client.yml", templates.rest.clientYml.template());
} else {
transfer(targetPath, (testConfigFolder).replace(".", separator), "client.yml", templates.rest.clientYml.template());
}

transfer(targetPath, (configFolder).replace(".", separator), "primary.crt", templates.rest.primaryCrt.template());
transfer(targetPath, (configFolder).replace(".", separator), "secondary.crt", templates.rest.secondaryCrt.template());
if(kafkaProducer) {
Expand All @@ -174,29 +159,16 @@ public void generate(final String targetPath, Object model, JsonNode config) thr
transfer(targetPath, (configFolder).replace(".", separator), "schema-registry.yml", templates.rest.schemaRegistryYml.template());
}

// mask
transfer(targetPath, (configFolder).replace(".", separator), "mask.yml", templates.rest.maskYml.template());
// logging
transfer(targetPath, (multipleModule ? "server.src.main.resources" : "src.main.resources").replace(".", separator), "logback.xml", templates.rest.logback.template(rootPackage));
transfer(targetPath, (multipleModule ? "server.src.test.resources" : "src.test.resources").replace(".", separator), "logback-test.xml", templates.rest.logback.template(rootPackage));

// exclusion list for Config module
transfer(targetPath, (configFolder).replace(".", separator), "config.yml", templates.rest.config.template(config));

transfer(targetPath, (configFolder).replace(".", separator), "audit.yml", templates.rest.auditYml.template());
transfer(targetPath, (configFolder).replace(".", separator), "body.yml", templates.rest.bodyYml.template());
transfer(targetPath, (configFolder).replace(".", separator), "info.yml", templates.rest.infoYml.template());
transfer(targetPath, (configFolder).replace(".", separator), "correlation.yml", templates.rest.correlationYml.template());
transfer(targetPath, (configFolder).replace(".", separator), "metrics.yml", templates.rest.metricsYml.template());
transfer(targetPath, (configFolder).replace(".", separator), "sanitizer.yml", templates.rest.sanitizerYml.template());
transfer(targetPath, (configFolder).replace(".", separator), "traceability.yml", templates.rest.traceabilityYml.template());
transfer(targetPath, (configFolder).replace(".", separator), "health.yml", templates.rest.healthYml.template());
// added with #471
transfer(targetPath, (configFolder).replace(".", separator), "app-status.yml", templates.rest.appStatusYml.template());
// values.yml file, transfer to suppress the warning message during start startup and encourage usage.
transfer(targetPath, (configFolder).replace(".", separator), "values.yml", templates.rest.values.template());
// add portal-registry.yml
transfer(targetPath, (configFolder).replace(".", separator), "portal-registry.yml", templates.rest.portalRegistryYml.template(serviceId));
transfer(targetPath, (configFolder).replace(".", separator), "values.yml",
templates.rest.values.template(serviceId, enableHttp, httpPort, enableHttps, httpsPort, enableHttp2, enableRegistry, version, config));
transfer(targetPath, (testConfigFolder).replace(".", separator), "values.yml",
templates.rest.values.template(serviceId, enableHttp, "49587", enableHttps, "49588", enableHttp2, enableRegistry, version, config));

}
// routing handler
transfer(targetPath, (configFolder).replace(".", separator), "handler.yml",
Expand Down Expand Up @@ -255,7 +227,7 @@ public void generate(final String targetPath, Object model, JsonNode config) thr
if (multipleModule) {
transfer(targetPath, (serverFolder).replace(".", separator), className + ".java", templates.rest.handler.template(handlerPackage, servicePackage, modelPackage, className, serviceName, requestModelName, parameters));
} else {
transfer(targetPath, (serverFolder).replace(".", separator), className + ".java", templates.rest.handlerSingle.template(handlerPackage, servicePackage, modelPackage, className, serviceName, requestModelName, parameters));
transfer(targetPath, (serverFolder).replace(".", separator), className + ".java", templates.rest.handlerSingle.template(handlerPackage, servicePackage, modelPackage, className, serviceName, requestModelName, example, parameters));
}
if (multipleModule) {
if (checkExist(targetPath, (serviceFolder).replace(".", separator), serviceName + ".java") && !overwriteHandler) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9c998fe

Please sign in to comment.