mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-13 22:50:41 +00:00
feat: add extra_tags
option to set tags including additional registries (#134)
This commit is contained in:
parent
4171f3d711
commit
0bd2634a1e
@ -117,6 +117,14 @@ properties:
|
||||
type: string
|
||||
required: false
|
||||
|
||||
extra_tags:
|
||||
description: |
|
||||
Set additional tags to be used for the image. Additional tags can also be loaded from an `.extratags` file. This function can be used
|
||||
to push images to multiple registries at once. Therefore, it is necessary to use the `config` flag to provide a configuration file
|
||||
that contains the authentication information for all used registries.
|
||||
type: list
|
||||
required: false
|
||||
|
||||
build_args:
|
||||
description: Ccustom build arguments to pass to the build.
|
||||
type: list
|
||||
|
@ -158,6 +158,14 @@ 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: "additional tags to use for the image including registry",
|
||||
FilePath: ".extratags",
|
||||
Destination: &settings.Build.ExtraTags,
|
||||
Category: category,
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "args",
|
||||
EnvVars: []string{"PLUGIN_BUILD_ARGS"},
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user