Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dagger-ci' into dagger-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
RetGal committed Nov 12, 2024
2 parents 5d0ea15 + 612828f commit c47166b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions ci/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"dagger/ci/internal/dagger"
"fmt"
"sync"
)

type Ci struct{}
Expand Down Expand Up @@ -160,3 +161,36 @@ func (m *Ci) Ci(ctx context.Context, dir *dagger.Directory) *Results {
Image: image,
}
}

// Executes all the steps and returns a Results object
func (m *Ci) CiIntegration(ctx context.Context, dir *dagger.Directory) *Results {
var wg sync.WaitGroup
wg.Add(3)

var lintOutput, _ = func() (string, error) {
defer wg.Done()
return "empty", error(nil) //m.Lint(ctx, dir)
}()

var securityScan = func() *dagger.File {
defer wg.Done()
return m.Sast(ctx, dir)
}()

//vulnerabilityScan := m.Vulnscan(ctx, m.SbomBuild(ctx, dir))

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

// This Blocks the execution until its counter become 0
wg.Wait()

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

0 comments on commit c47166b

Please sign in to comment.