adds extra_tags setting which allows for tags that include additional registries to be specified

This commit is contained in:
Richard Jennings 2022-10-07 18:30:55 +01:00
parent 4171f3d711
commit 8a9093985f
4 changed files with 17 additions and 0 deletions

View File

@ -117,6 +117,11 @@ properties:
type: string
required: false
extra_tags:
description: Set additional tags which include the resgitry.
type: list
required: false
build_args:
description: Ccustom build arguments to pass to the build.
type: list

View File

@ -158,6 +158,13 @@ func settingsFlags(settings *plugin.Settings, category string) []cli.Flag {
Destination: &settings.Build.TagsSuffix,
Category: category,
},
&cli.StringSliceFlag{
Name: "extra.tags",
EnvVars: []string{"PLUGIN_EXTRA_TAGS"},
Usage: "extra tags to use for the image including registry",
Destination: &settings.Build.ExtraTags,
Category: category,
},
&cli.StringSliceFlag{
Name: "args",
EnvVars: []string{"PLUGIN_BUILD_ARGS"},

View File

@ -123,6 +123,10 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd {
args = append(args, "-t", fmt.Sprintf("%s:%s", build.Repo, arg))
}
for _, arg := range build.ExtraTags.Value() {
args = append(args, "-t", arg)
}
for _, arg := range build.Labels.Value() {
args = append(args, "--label", arg)
}

View File

@ -47,6 +47,7 @@ type Build struct {
TagsAuto bool // Docker build auto tag
TagsSuffix string // Docker build tags with suffix
Tags cli.StringSlice // Docker build tags
ExtraTags cli.StringSlice // Docker build tags including registry
Platforms cli.StringSlice // Docker build target platforms
Args cli.StringSlice // Docker build args
ArgsEnv cli.StringSlice // Docker build args from env