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

Add support for extras in build-cpio #1394

Merged
merged 1 commit into from
Nov 9, 2024
Merged
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
12 changes: 12 additions & 0 deletions internal/cli/build-cpio.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ func buildCPIO() *cobra.Command {
var buildDate string
var buildArch string
var sbomPath string
var extraKeys []string
var extraBuildRepos []string
var extraRuntimeRepos []string
var extraPackages []string

cmd := &cobra.Command{
Use: "build-cpio",
Expand All @@ -45,6 +49,10 @@ func buildCPIO() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
return BuildCPIOCmd(cmd.Context(), args[1],
build.WithConfig(args[0], []string{}),
build.WithExtraKeys(extraKeys),
build.WithExtraBuildRepos(extraBuildRepos),
build.WithExtraRuntimeRepos(extraRuntimeRepos),
build.WithExtraPackages(extraPackages),
build.WithBuildDate(buildDate),
build.WithSBOM(sbomPath),
build.WithArch(types.ParseArchitecture(buildArch)),
Expand All @@ -55,6 +63,10 @@ func buildCPIO() *cobra.Command {
cmd.Flags().StringVar(&buildDate, "build-date", "", "date used for the timestamps of the files inside the image")
cmd.Flags().StringVar(&buildArch, "build-arch", runtime.GOARCH, "architecture to build for -- default is Go runtime architecture")
cmd.Flags().StringVar(&sbomPath, "sbom-path", "", "generate an SBOM")
cmd.Flags().StringSliceVarP(&extraKeys, "keyring-append", "k", []string{}, "path to extra keys to include in the keyring")
cmd.Flags().StringSliceVarP(&extraBuildRepos, "build-repository-append", "b", []string{}, "path to extra repositories to include")
cmd.Flags().StringSliceVarP(&extraRuntimeRepos, "repository-append", "r", []string{}, "path to extra repositories to include")
cmd.Flags().StringSliceVarP(&extraPackages, "package-append", "p", []string{}, "extra packages to include")

return cmd
}
Expand Down
Loading