Skip to content

Commit b7066e6

Browse files
committed
use directories
1 parent bab1988 commit b7066e6

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

ci/main.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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
5758
func (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"

dagger.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"dependencies": [
88
{
99
"name": "pitc-flow",
10-
"source": "github.com/puzzle/dagger-module-pitc-flow/pitc-flow@e1fd90f7f82f61669da11508ff9eaed1ff4e0b1a",
11-
"pin": "e1fd90f7f82f61669da11508ff9eaed1ff4e0b1a"
10+
"source": "github.com/puzzle/dagger-module-pitc-flow/pitc-flow@81c5c2f42ab4928df26e07ae7fa9bc464f7f98e1",
11+
"pin": "81c5c2f42ab4928df26e07ae7fa9bc464f7f98e1"
1212
}
1313
],
1414
"source": "ci"

0 commit comments

Comments
 (0)