Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Jshaffer/testing option where a dependency is added if an option is selected #52

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions accelerator.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
accelerator:
displayName: Tanzu Java Web App
description: A sample Spring Boot web application built with Tanzu supply-chain
displayName: Tanzu Java Spring Api Provider (40)
description: A sample Spring Boot web application built with Tanzu supply-chain that uses sprindocs to generate an openAPI document.
iconUrl: https://github.com/sample-accelerators/icons/raw/master/icon-boot.png
tags:
- java
- spring
- web
- tanzu
- openAPI
- api

options:
- name: repositoryPrefix
inputType: text
label: Prefix for the container image repository
defaultValue: dev.local
required: true
- name: exposeOpenAPIEndpoint
label: Expose OpenAPI endpoint?
display: true
dataType: boolean
defaultValue: false

engine:
merge:
- include: [ "**/*" ]
exclude: [ "config/*.yaml", "Tiltfile", "README.md", "grype.yaml", "catalog/*.yaml", ".github/workflows/**" ]
exclude: [ "config/*.yaml", "Tiltfile", "README.md", "grype.yaml", "catalog/*.yaml", ".github/workflows/**", "pom.xml" ]
- include: [ "config/*.yaml", "Tiltfile" ]
chain:
- type: ReplaceText
Expand All @@ -43,3 +50,15 @@ engine:
with: "#artifactId"
- type: RewritePath
rewriteTo: "#filename"
- include: [ "pom.xml" ]
chain:
- type: ReplaceText
condition: "#exposeOpenAPIEndpoint"
substitutions:
- text: <!-- OPEN API DEPENDENCY PLACEHOLDER -->
with: "'<dependency>\n <groupId>org.springdoc</groupId>\n <artifactId>springdoc-openapi-ui</artifactId>\n <version>1.6.9</version>\n </dependency>'"
- type: ReplaceText
condition: "!#exposeOpenAPIEndpoint"
substitutions:
- text: <!-- OPEN API DEPENDENCY PLACEHOLDER -->
with: "''"
10 changes: 10 additions & 0 deletions config/workload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@ metadata:
labels:
apps.tanzu.vmware.com/workload-type: web
app.kubernetes.io/part-of: tanzu-java-web-app
app.tanzu.vmware.com/register-api: "true"
apps.tanzu.vmware.com/has-tests: "true"
apis.apps.tanzu.vmware.com/register-api: "true"
spec:
params:
- name: annotations
value:
autoscaling.knative.dev/minScale: "1"
- name: api_descriptor
value:
type: openapi
location:
path: "/v3/api-docs"
owner: team-petclinic
description: "A set of API endpoints to manage the resources within the petclinic app."
source:
git:
url: https://github.com/sample-accelerators/tanzu-java-web-app
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
<optional>true</optional>
</dependency>

<!-- OPEN API DEPENDENCY PLACEHOLDER -->

</dependencies>

<build>
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ management:
include: "*"
endpoint:
health:
show-details: always
show-details: always