forked from sample-accelerators/java-functions-accelerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
accelerator.yaml
147 lines (136 loc) · 4.03 KB
/
accelerator.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
accelerator:
displayName: Java Function
description: Java function powered by Function Buildpacks for Knative
iconUrl: https://raw.githubusercontent.com/sample-accelerators/java-functions-accelerator/main/functions-icon.png
tags:
- java
- spring
- function
- serverless
- knative
# Accelerator GUI
options:
- name: buildType
inputType: select
label: Project Type
choices:
- value: maven
text: Maven
- value: gradle
text: Gradle
defaultValue: maven
required: true
- name: interfaceType
inputType: select
label: Event Type
choices:
- value: http
text: HTTP Function
- value: cloudevents
text: CloudEvents Function (Experimental)
defaultValue: http
required: true
- name: includeTap
label: "Include TAP deployment resources?"
inputType: checkbox
dataType: boolean
defaultValue: true
- name: gitUrl
label: Git Repository URL
description: Change this to the Git repository you will use to store this function's files
inputType: text
dependsOn:
name: includeTap
dataType: string
required: true
defaultValue: "https://github.com/sample-accelerators/java-functions-accelerator.git"
- name: gitBranch
label: Git Repository Branch
description: The corresponding branch of the Git repository
inputType: text
dependsOn:
name: includeTap
dataType: string
required: true
defaultValue: "main"
engine:
merge:
# Core files
- include: [ "src/**", "func.yaml", "LICENSE", "NOTICE", ".gitignore" ]
# README files
- include: [ "README.md", "DEPLOYING.md" ]
chain:
- type: ReplaceText
substitutions:
- text: my-java-fn
with: "#artifactId"
# Maven files
- include: [ ".mvn/**", "mvnw", "mvnw.bat" ]
condition: "#buildType == 'maven'"
- include: [ "pom.xml" ]
condition: "#buildType == 'maven' && #interfaceType == 'http'"
chain:
- type: ReplaceText
substitutions:
- text: my-java-fn
with: "#artifactId"
- include: [ "cloudevents/pom.xml", "cloudevents/jar-assembly.xml" ]
condition: "#buildType == 'maven' && #interfaceType == 'cloudevents'"
chain:
- type: ReplaceText
substitutions:
- text: my-java-fn
with: "#artifactId"
- type: RewritePath
rewriteTo: "#filename"
# Gradle files
- include: [ "gradle/**", "gradlew", "gradlew.bat" ]
condition: "#buildType == 'gradle'"
- include: [ "settings.gradle" ]
condition: "#buildType == 'gradle'"
chain:
- type: ReplaceText
substitutions:
- text: my-java-fn
with: "#artifactId"
- include: [ "build.gradle" ]
condition: "#buildType == 'gradle' && #interfaceType == 'http'"
- include: [ "cloudevents/build.gradle" ]
condition: "#buildType == 'gradle' && #interfaceType == 'cloudevents'"
chain:
- type: RewritePath
rewriteTo: "#filename"
# Replace HTTP with CloudEvents
- include: [ "cloudevents/Hire.java" ]
condition: "#interfaceType == 'cloudevents'"
chain:
- type: RewritePath
rewriteTo: "'src/main/java/functions/Hire.java'"
# TAP files
- include: [ "config/workload.yaml" ]
condition: "#includeTap"
chain:
- type: ReplaceText
substitutions:
- text: https://github.com/sample-accelerators/java-functions-accelerator.git
with: "#gitUrl"
- text: main
with: "#gitBranch"
- text: my-java-fn
with: "#artifactId"
- type: RewritePath
rewriteTo: "'config/' + #filename"
- include: [ "catalog/catalog-info.yaml" ]
condition: "#includeTap"
chain:
- type: ReplaceText
substitutions:
- text: my-java-fn
with: "#artifactId"
- include: [ "Tiltfile" ]
condition: "#includeTap"
chain:
- type: ReplaceText
substitutions:
- text: my-java-fn
with: "#artifactId"