Skip to content

Commit

Permalink
Expose an example config.yaml over the registry's REST api
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartisk committed Jun 1, 2023
1 parent 13220b5 commit 9bfd90a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/java/io/quarkus/registry/app/DatabaseRegistryClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,28 @@ public Response dump(@Context jakarta.ws.rs.core.HttpHeaders headers) {
return Response.ok(sb.toString()).build();
}

@GET
@Path("/config.yaml")
@Produces(MediaType.TEXT_PLAIN)
@Operation(summary = "Example Quarkus Registry Client configuration file")
public Response clientConfigYaml() {
String response = """
# Example Quarkus Registry Client configuration file (save this as ~/.quarkus/config.yaml)
---
registries:
- %s:
update-policy: "always"
descriptor:
artifact: "%s:quarkus-registry-descriptor::json:1.0-SNAPSHOT"
maven:
repository:
url: "%s"
""".formatted(mavenConfig.getRegistryId(),
mavenConfig.getRegistryGroupId(),
mavenConfig.getRegistryUrl());
return Response.ok(response).build();
}

private PlatformCatalog toPlatformCatalog(List<PlatformRelease> platformReleases, boolean all) {
PlatformCatalog.Mutable catalog = PlatformCatalog.builder();
platformReleases.sort((o1, o2) -> Version.RELEASE_IMPORTANCE_COMPARATOR.compare(o1.version, o2.version));
Expand Down

0 comments on commit 9bfd90a

Please sign in to comment.