Skip to content

Commit

Permalink
export files
Browse files Browse the repository at this point in the history
  • Loading branch information
chrira committed Nov 13, 2024
1 parent d13e242 commit f7da10c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/log/*.log
/tmp
!/tmp/pids
out/

test/coverage
test/reports
Expand Down
22 changes: 21 additions & 1 deletion ci/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ func (m *Ci) CiIntegration(
// ignore linter failures
// +optional
// +default=false
pass bool) *Results {
pass bool,
) string {
var wg sync.WaitGroup
wg.Add(5)

Expand All @@ -227,10 +228,12 @@ func (m *Ci) CiIntegration(
return m.Vulnscan(m.Sbom(m.Build(ctx, dir)))
}()

/*
var image = func() *dagger.Container {
defer wg.Done()
return m.Build(ctx, dir)
}()
*/

var testReports = func() *dagger.Directory {
defer wg.Done()
Expand All @@ -240,11 +243,28 @@ func (m *Ci) CiIntegration(
// This Blocks the execution until its counter become 0
wg.Wait()

/*
return &Results{
TestReports: testReports,
LintOutput: lintOutput,
SecurityScan: securityScan,
VulnerabilityScan: vulnerabilityScan,
Image: image,
}
*/

// TODO: fail on errors of the functions!


result_container := dag.Container().
From("alpine:latest").
WithWorkdir("/tmp/out").
//WithExec([]string{"cat", securityScan, "rails", "assets:precompile"}).
//WithExec([]string{"sh", "-c", `cat lintOutput > /tmp/out/lint/lint.json`}).
WithExec([]string{"/bin/sh", "-c", `echo foo > /tmp/out/foo`}).
WithExec([]string{"/bin/sh", "-c", fmt.Sprintf("echo %s > /tmp/out/foo.log", lintOutput)}).
WithFile("/tmp/out/scan/", securityScan)
//return result_container.Directory(".")
result_container.Directory(".")
return lintOutput
}

0 comments on commit f7da10c

Please sign in to comment.