@@ -50,15 +50,16 @@ func (m *Ci) BuildLintContainer(
5050 WithMountedDirectory ("/mnt" , dir ).
5151 WithWorkdir ("/mnt" ).
5252 WithExec ([]string {"gem" , "install" , "haml-lint" }).
53+ WithExec ([]string {"sh" , "-c" , "mkdir -p /mnt/lint" }).
5354 WithExec (m .lintCommand (pass ))
5455}
5556
5657// Returns the lint command
5758func (m * Ci ) lintCommand (pass bool ) []string {
5859 if pass {
59- return []string {"sh" , "-c" , "haml-lint -r json . > lint.json || true" }
60+ return []string {"sh" , "-c" , "haml-lint -r json . > lint/lint .json || true" }
6061 }
61- return []string {"sh" , "-c" , "haml-lint -r json . > lint.json" }
62+ return []string {"sh" , "-c" , "haml-lint -r json . > lint/lint .json" }
6263}
6364
6465// Returns a sast container
@@ -67,7 +68,8 @@ func (m *Ci) BuildSastContainer(dir *dagger.Directory) *dagger.Container {
6768 From ("presidentbeef/brakeman:latest" ).
6869 WithMountedDirectory ("/app" , dir ).
6970 WithWorkdir ("/app" ).
70- WithExec ([]string {"/usr/src/app/bin/brakeman" })
71+ WithExec ([]string {"sh" , "-c" , "mkdir -p /app/sast" }).
72+ WithExec ([]string {"/usr/src/app/bin/brakeman -o sast/brakeman-output.tabs" })
7173}
7274
7375// Creates a PostgreSQL service for local testing based on the official image with the provided version. If no version is provided, 'latest' will be used.
@@ -156,8 +158,8 @@ func (m *Ci) Ci(
156158 // +default=false
157159 pass bool ,
158160) * Results {
159- lintOutput := dag .PitcFlow ().Lint (m .BuildLintContainer (dir , pass ), "lint.json " )
160- securityScan := dag .PitcFlow ().Sast (m .BuildSastContainer (dir ), "/app/brakeman-output.tabs " )
161+ lintOutput := dag .PitcFlow ().Lint (m .BuildLintContainer (dir , pass ), "lint" )
162+ securityScan := dag .PitcFlow ().Sast (m .BuildSastContainer (dir ), "/app/sast " )
161163 image := dag .PitcFlow ().Build (dir )
162164 sbom := dag .PitcFlow ().Sbom (image )
163165 vulnerabilityScan := dag .PitcFlow ().Vulnscan (sbom )
@@ -229,12 +231,12 @@ func (m *Ci) CiIntegration(
229231 dagger.PitcFlowFlexOpts {
230232 // lint container
231233 LintContainer : lintContainer ,
232- // lint report file name "lint.json"
233- LintReport : "lint.json " ,
234+ // lint report directory name "lint/ lint.json"
235+ LintReportDir : "/ lint" ,
234236 // sast container
235237 SastContainer : sastContainer ,
236- // security scan report file name "/app/brakeman-output.tabs"
237- SastReport : "/app/brakeman-output.tabs " ,
238+ // security scan report directory name "/app/sast /brakeman-output.tabs"
239+ SastReportDir : "/app/sast " ,
238240 // test container
239241 TestContainer : testContainer ,
240242 // test report folder name "/mnt/test/reports"
0 commit comments