Skip to content

Commit

Permalink
Add support for extras in build-cpio (#1394)
Browse files Browse the repository at this point in the history
These are copied directly from `build`

Signed-off-by: Matt Moore <mattmoor@chainguard.dev>
  • Loading branch information
mattmoor authored Nov 9, 2024
1 parent 0725f6a commit 46ce0d8
Showing 1 changed file with 12 additions and 0 deletions.
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

0 comments on commit 46ce0d8

Please sign in to comment.