Skip to content

Commit 2a7928c

Browse files
authored
Add config documentation for S3 sink (#518)
Fix for #515 Adds configuration documentation to web site.
1 parent ea3ffa9 commit 2a7928c

File tree

4 files changed

+73
-0
lines changed

4 files changed

+73
-0
lines changed

s3-sink-connector/build.gradle.kts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ idea {
7575
dependencies {
7676
compileOnly(apache.kafka.connect.api)
7777
compileOnly(apache.kafka.connect.runtime)
78+
compileOnly(project(":site"))
79+
compileOnly("org.apache.velocity:velocity-engine-core:2.4.1")
80+
compileOnly("org.apache.velocity.tools:velocity-tools-generic:3.1")
7881

7982
implementation(project(":commons"))
8083
testImplementation(testFixtures(project(":commons")))
@@ -257,3 +260,47 @@ signing {
257260
}
258261
signatureTypes = ASCSignatureProvider()
259262
}
263+
264+
/** ******************************* */
265+
/* Documentation building section */
266+
/** ******************************* */
267+
tasks.register("buildDocs") {
268+
dependsOn("buildConfigMd")
269+
dependsOn("buildConfigYml")
270+
}
271+
272+
tasks.register<JavaExec>("buildConfigMd") {
273+
mainClass = "io.aiven.kafka.connect.tools.ConfigDoc"
274+
classpath =
275+
sourceSets.main
276+
.get()
277+
.compileClasspath
278+
.plus(files(tasks.jar))
279+
.plus(sourceSets.main.get().runtimeClasspath)
280+
args =
281+
listOf(
282+
"io.aiven.kafka.connect.s3.config.S3SinkConfig",
283+
"configDef",
284+
"src/templates/configData.md.vm",
285+
"build/site/markdown/s3-sink-connector/S3SinkConfig.md")
286+
}
287+
288+
tasks.register<JavaExec>("buildConfigYml") {
289+
mainClass = "io.aiven.kafka.connect.tools.ConfigDoc"
290+
classpath =
291+
sourceSets.main
292+
.get()
293+
.compileClasspath
294+
.plus(files(tasks.jar))
295+
.plus(sourceSets.main.get().runtimeClasspath)
296+
args =
297+
listOf(
298+
"io.aiven.kafka.connect.s3.config.S3SinkConfig",
299+
"configDef",
300+
"src/templates/configData.yml.vm",
301+
"build/site/s3-sink-connector/S3SinkConfig.yml")
302+
}
303+
304+
/** ****************************** */
305+
/* End of documentation section */
306+
/** ****************************** */
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
# S3 Sink Configuration
3+
4+
The complete S3 sink configuration file
5+
6+
#foreach ($section in $sections)
7+
${esc.hash}${esc.hash} ${section.displayName}
8+
- Default value: ${section.getDefaultValue()|"none"}
9+
- Type: $section.type
10+
- Valid values: ${section.validator|"no restrictions"}
11+
- Importance: $section.importance
12+
13+
$section.documentation
14+
15+
#end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
S3SinkConfigDef:
2+
#foreach ($section in $sections)
3+
-
4+
name: ${section.displayName}
5+
documentation: $section.documentation
6+
type: $section.type
7+
default: ${section.getDefaultValue()|"none"}
8+
validValues: ${section.validator|"no restrictions"}
9+
importance: $section.importance
10+
#end

site/src/site/site.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ under the License.
8181

8282
<item name="Sink">
8383
<item name="Introduction" href="s3-sink-connector/index.html"/>
84+
<item name="Configuration" href="s3-sink-connector/S3SinkConfig.html"/>
8485
<item name="Javadoc" href="s3-sink-connector/javadoc/index.html"/>
8586
</item>
8687

0 commit comments

Comments
 (0)