Skip to content

Commit 0794f27

Browse files
committed
Test PublishHTML
1 parent 8a39f16 commit 0794f27

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/ru/pulsar/jenkins/library/steps/Swagger.groovy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package ru.pulsar.jenkins.library.steps
22

3+
import groovy.io.FileType
34
import ru.pulsar.jenkins.library.IStepExecutor
45
import ru.pulsar.jenkins.library.configuration.JobConfiguration
56
import ru.pulsar.jenkins.library.ioc.ContextRegistry
@@ -8,6 +9,7 @@ import ru.pulsar.jenkins.library.utils.OscriptModules
89

910
class Swagger {
1011
public static final String OUT = 'build/out/swagger/'
12+
public static final String OUT_HTML = 'build/out/swagger/html/'
1113

1214
private final JobConfiguration config;
1315

@@ -31,6 +33,22 @@ class Swagger {
3133

3234
steps.cmd(swaggerPath + " generate --src-path $config.srcDir --out $OUT")
3335

36+
def dir = new File($OUT)
37+
dir.eachFile(FileType.FILES){
38+
String reportdir = "$OUT_HTML$it.name"
39+
Logger.println(it.name)
40+
Logger.println(reportdir)
41+
Logger.println(it.path)
42+
steps.cmd("bootprint openapi $it.path $reportdir")
43+
publishHTML (target : [allowMissing: false,
44+
alwaysLinkToLastBuild: true,
45+
keepAll: true,
46+
reportDir: $reportdir,
47+
reportFiles: 'index.html',
48+
reportName: 'Swagger API',
49+
reportTitles: 'API $it.name'])
50+
}
51+
3452
steps.archiveArtifacts(OUT)
3553
}
3654
}

0 commit comments

Comments
 (0)