Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dagger ci #221

Draft
wants to merge 48 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2c85610
build and lint using dagger
RetGal Nov 11, 2024
dabf839
add missing file, build from dockerfile
RetGal Nov 11, 2024
eb54851
Removes generated dagger.gen.go
buehlmann Nov 11, 2024
a54acc8
Call linter by dagger
buehlmann Nov 11, 2024
a02b492
Run lint on push to branch dagger-ci
buehlmann Nov 11, 2024
7d24052
Use dagger engine v0.14.0
buehlmann Nov 11, 2024
ac5d073
Add module to lint action
buehlmann Nov 11, 2024
98c2543
Set working directory
buehlmann Nov 11, 2024
e2e67ad
Add checkout action
buehlmann Nov 11, 2024
c494a78
fix lint step
RetGal Nov 11, 2024
e16d612
Add services for memcached and postgresql
buehlmann Nov 11, 2024
b6dfe30
add brakeman step
SylivanKenobi Nov 12, 2024
181c36a
add sbom creation and vulnerability scan
SylivanKenobi Nov 12, 2024
e9a1d13
Use memcached image
buehlmann Nov 12, 2024
3e49bdd
Implement integration testing
buehlmann Nov 12, 2024
e53efab
add comments, sdd SbomBuild method
SylivanKenobi Nov 12, 2024
ee5266e
Integrate dagger cloud
buehlmann Nov 12, 2024
535d644
add all step
RetGal Nov 12, 2024
05a1fb0
set repository for trivy
SylivanKenobi Nov 12, 2024
612828f
run steps in parallel
chrira Nov 12, 2024
5d0ea15
dedup trivy
RetGal Nov 12, 2024
c47166b
Merge remote-tracking branch 'origin/dagger-ci' into dagger-ci
RetGal Nov 12, 2024
3dc71f7
redup trivy
RetGal Nov 12, 2024
b988bf7
add dagger pipeline
chrira Nov 12, 2024
c65e996
readd ci-integration function
chrira Nov 12, 2024
e4c5270
export files, add docu
RetGal Nov 13, 2024
cf29681
integrate vulnerabilty scan
RetGal Nov 13, 2024
228aadb
fix dagger-lint
RetGal Nov 13, 2024
995a604
Fixes test job, excluding integration tests
buehlmann Nov 13, 2024
6111d05
Add job for test execution
buehlmann Nov 13, 2024
324ce47
Fix test function
buehlmann Nov 13, 2024
608ca56
Add test step to ci job
buehlmann Nov 13, 2024
ae0c986
Remove test reporter
buehlmann Nov 13, 2024
7525311
Remove terminal stmt
buehlmann Nov 13, 2024
e8f2310
Integrate Minitest reports
buehlmann Nov 13, 2024
587ded1
add ignore linter failures
RetGal Nov 13, 2024
8299596
Add test reports to single job
buehlmann Nov 13, 2024
a0797d3
Export test results
buehlmann Nov 13, 2024
d13e242
Use test-reports/*.xml as path for test reports
buehlmann Nov 13, 2024
f7da10c
export files
chrira Nov 13, 2024
9dbef16
file export
chrira Nov 13, 2024
5aed25c
add export
chrira Nov 13, 2024
465cbb1
pipeline export files
chrira Nov 13, 2024
a26a8f7
do not fail on lint
chrira Nov 13, 2024
36af895
vuln check not parallel
chrira Nov 14, 2024
8b3784b
all report -> unit test
chrira Nov 14, 2024
215af68
archive artifacts
chrira Nov 14, 2024
09d8eff
Add build step
buehlmann Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add all step
  • Loading branch information
RetGal committed Nov 12, 2024
commit 535d6445e906e6d13635b3a7e4c1d059c95f9271
23 changes: 22 additions & 1 deletion ci/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ import (

type Ci struct{}

type Results struct {
LintOutput string
SecurityScan *dagger.File
VulnerabilityScan *dagger.File
Image *dagger.Container
}

// Returns a Container built from the Dockerfile in the provided Directory
func (m *Ci) Build(_ context.Context, dir *dagger.Directory) *dagger.Container {
return dag.Container().Build(dir)
Expand All @@ -34,7 +41,7 @@ func (m *Ci) Lint(ctx context.Context, dir *dagger.Directory) (string, error) {
WithMountedDirectory("/mnt", dir).
WithWorkdir("/mnt").
WithExec([]string{"gem", "install", "haml-lint"}).
WithExec([]string{"haml-lint", "--reporter", "json", "."}).
WithExec([]string{"haml-lint", "-r", "json", "."}).
Stdout(ctx)
}

Expand Down Expand Up @@ -128,3 +135,17 @@ func (m *Ci) Vulnscan(ctx context.Context, sbom *dagger.File) *dagger.File {

return trivy.Sbom(sbom).Report("json")
}

// Executes all the steps and returns a Results object
func (m *Ci) Ci(ctx context.Context, dir *dagger.Directory) *Results {
lintOutput, _ := m.Lint(ctx, dir)
securityScan := m.Sast(ctx, dir)
vulnerabilityScan := m.Vulnscan(ctx, m.SbomBuild(ctx, dir))
image := m.Build(ctx, dir)
return &Results{
LintOutput: lintOutput,
SecurityScan: securityScan,
VulnerabilityScan: vulnerabilityScan,
Image: image,
}
}
Loading