diff --git a/firestartr-bootstrap/commands.go b/firestartr-bootstrap/commands.go index 231c5e6b..8e2750b4 100644 --- a/firestartr-bootstrap/commands.go +++ b/firestartr-bootstrap/commands.go @@ -707,3 +707,14 @@ func (m *FirestartrBootstrap) CmdRunBootstrap( //m.CmdPushArgo(ctx) } + +func (m *FirestartrBootstrap) CmdDebugBootstrap( + ctx context.Context, + cacheVolume *dagger.CacheVolume, +) *dagger.Container { + + + return dag.Container(). + From("alpine:3.21.3"). + WithMountedCache("/cache", cacheVolume) +} diff --git a/firestartr-bootstrap/import.go b/firestartr-bootstrap/import.go index 84245bf0..a5354193 100644 --- a/firestartr-bootstrap/import.go +++ b/firestartr-bootstrap/import.go @@ -53,7 +53,7 @@ func (m *FirestartrBootstrap) RunImporter( "--filters", "gh-repo,SKIP=SKIP", } - kindContainer = kindContainer. + kindContainer, err = kindContainer. WithDirectory("/import", claimsDir). WithDirectory("/import", crsDir). WithDirectory("/config", m.CrsDotConfigDir). @@ -70,7 +70,22 @@ func (m *FirestartrBootstrap) RunImporter( "npm", "install", "-g", fmt.Sprintf("@firestartr/cli@%s", m.Bootstrap.Firestartr.CliVersion), }). - WithExec(importCommand) + WithExec(importCommand). + Sync(ctx) + + + + // we copy even it there was an error + kindContainer, _ = kindContainer. + WithExec([]string{ + "cp", "-a", "/import", "/cache", + }). + Sync(ctx) + + if err != nil { + + return nil, fmt.Errorf("Error importing: %w", err) + } kindContainer, err = m.ApplyFirestartrCrs( ctx, @@ -83,8 +98,16 @@ func (m *FirestartrBootstrap) RunImporter( "FirestartrGithubRepositoryFeature.*", }, ) + + // we copy even it there was an error + kindContainer, _ = kindContainer. + WithExec([]string{ + "cp", "-a", "/import", "/cache", + }). + Sync(ctx) + if err != nil { - return nil, err + return nil, fmt.Errorf("Error rendering and applyig the imported crs: %w", err) } return kindContainer, nil