1
1
package ru.pulsar.jenkins.library.steps
2
2
3
+ import groovy.io.FileType
3
4
import ru.pulsar.jenkins.library.IStepExecutor
4
5
import ru.pulsar.jenkins.library.configuration.JobConfiguration
5
6
import ru.pulsar.jenkins.library.ioc.ContextRegistry
@@ -8,6 +9,7 @@ import ru.pulsar.jenkins.library.utils.OscriptModules
8
9
9
10
class Swagger {
10
11
public static final String OUT = ' build/out/swagger/'
12
+ public static final String OUT_HTML = ' build/out/swagger/html/'
11
13
12
14
private final JobConfiguration config;
13
15
@@ -31,6 +33,22 @@ class Swagger {
31
33
32
34
steps. cmd(swaggerPath + " generate --src-path $config . srcDir --out $OUT " )
33
35
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
+
34
52
steps. archiveArtifacts(OUT )
35
53
}
36
54
}
0 commit comments