Skip to content

Commit 5aed25c

Browse files
committed
add export
1 parent 9dbef16 commit 5aed25c

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

ci/main.go

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ func (m *Ci) Lint(
4747
// ignore linter failures
4848
// +optional
4949
// +default=false
50-
pass bool) *dagger.File {
50+
pass bool,
51+
) *dagger.File {
5152
container := dag.Container().
5253
From("ruby:latest").
5354
WithMountedDirectory("/mnt", dir).
@@ -184,7 +185,8 @@ func (m *Ci) Ci(
184185
// ignore linter failures
185186
// +optional
186187
// +default=false
187-
pass bool) *Results {
188+
pass bool,
189+
) *Results {
188190
lintOutput := m.Lint(dir, pass)
189191
securityScan := m.Sast(dir)
190192
image := m.Build(ctx, dir)
@@ -211,7 +213,7 @@ func (m *Ci) CiIntegration(
211213
pass bool,
212214
) *dagger.Directory {
213215
var wg sync.WaitGroup
214-
wg.Add(5)
216+
wg.Add(4)
215217

216218
var lintOutput = func() *dagger.File {
217219
defer wg.Done()
@@ -228,10 +230,12 @@ func (m *Ci) CiIntegration(
228230
return m.Vulnscan(m.Sbom(m.Build(ctx, dir)))
229231
}()
230232

233+
/*
231234
var image = func() *dagger.Container {
232235
defer wg.Done()
233236
return m.Build(ctx, dir)
234237
}()
238+
*/
235239

236240
var testReports = func() *dagger.Directory {
237241
defer wg.Done()
@@ -241,24 +245,18 @@ func (m *Ci) CiIntegration(
241245
// This Blocks the execution until its counter become 0
242246
wg.Wait()
243247

244-
/*
245-
return &Results{
246-
TestReports: testReports,
247-
LintOutput: lintOutput,
248-
SecurityScan: securityScan,
249-
VulnerabilityScan: vulnerabilityScan,
250-
Image: image,
251-
}
252-
*/
253-
254248
// TODO: fail on errors of the functions!
255249

256-
250+
lintOutputName, _ := lintOutput.Name(ctx)
251+
securityScanName, _ := securityScan.Name(ctx)
252+
//vulnerabilityScanName, _ := vulnerabilityScan.Name(ctx)
257253
result_container := dag.Container().
258254
WithWorkdir("/tmp/out").
259-
WithFile("/tmp/out/lint/", lintOutput).
260-
WithFile("/tmp/out/scan/", securityScan).
261-
WithFile("/tmp/out/vuln/", vulnerabilityScan)
255+
WithFile(fmt.Sprintf("/tmp/out/lint/%s", lintOutputName), lintOutput).
256+
WithFile(fmt.Sprintf("/tmp/out/scan/%s", securityScanName), securityScan).
257+
//WithFile("/tmp/out/vuln/", vulnerabilityScan)
258+
WithDirectory("/tmp/out/tests/", testReports)
262259

260+
vulnerabilityScan.Name(ctx)
263261
return result_container.Directory(".")
264262
}

0 commit comments

Comments
 (0)