Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions firestartr-bootstrap/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
29 changes: 26 additions & 3 deletions firestartr-bootstrap/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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,
Expand All @@ -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
Expand Down
Loading