From f7da10ce43636d727c2fe68201baa07771bbb1ca Mon Sep 17 00:00:00 2001 From: Christoph Raaflaub Date: Wed, 13 Nov 2024 11:55:29 +0100 Subject: [PATCH] export files --- .gitignore | 1 + ci/main.go | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 51e3c8d0..139d21bd 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ /log/*.log /tmp !/tmp/pids +out/ test/coverage test/reports diff --git a/ci/main.go b/ci/main.go index c41f4226..e556b508 100644 --- a/ci/main.go +++ b/ci/main.go @@ -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) @@ -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() @@ -240,6 +243,7 @@ func (m *Ci) CiIntegration( // This Blocks the execution until its counter become 0 wg.Wait() + /* return &Results{ TestReports: testReports, LintOutput: lintOutput, @@ -247,4 +251,20 @@ func (m *Ci) CiIntegration( 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 }