Allow multible Repos (#22)
close partialy #18 we still need to handle multible registry login Reviewed-on: https://codeberg.org/woodpecker-plugins/plugin-docker-buildx/pulls/22
This commit is contained in:
parent
06d32b13a5
commit
10426e6a19
@ -189,7 +189,7 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag {
|
|||||||
Usage: "enables compression og the build context using gzip",
|
Usage: "enables compression og the build context using gzip",
|
||||||
Destination: &settings.Build.Compress,
|
Destination: &settings.Build.Compress,
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringSliceFlag{
|
||||||
Name: "repo",
|
Name: "repo",
|
||||||
EnvVars: []string{"PLUGIN_REPO"},
|
EnvVars: []string{"PLUGIN_REPO"},
|
||||||
Usage: "sets repository name for the image",
|
Usage: "sets repository name for the image",
|
||||||
|
2
docs.md
2
docs.md
@ -30,7 +30,7 @@ It will automatically generate buildkit configuration to use custom CA certifica
|
|||||||
| Settings Name | Default | Description
|
| Settings Name | Default | Description
|
||||||
| --------------------------| ----------------- | --------------------------------------------
|
| --------------------------| ----------------- | --------------------------------------------
|
||||||
| `dry-run` | `false` | disables docker push
|
| `dry-run` | `false` | disables docker push
|
||||||
| `repo` | *none* | sets repository name for the image
|
| `repo` | *none* | sets repository name for the image (can be a list)
|
||||||
| `username` | *none* | sets username to authenticates with
|
| `username` | *none* | sets username to authenticates with
|
||||||
| `password` | *none* | sets password / token to authenticates with
|
| `password` | *none* | sets password / token to authenticates with
|
||||||
| `email` | *none* | sets email address to authenticates with
|
| `email` | *none* | sets email address to authenticates with
|
||||||
|
@ -122,8 +122,10 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd {
|
|||||||
args = append(args, "--platform", strings.Join(build.Platforms.Value()[:], ","))
|
args = append(args, "--platform", strings.Join(build.Platforms.Value()[:], ","))
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, arg := range build.Tags.Value() {
|
for _, tag := range build.Tags.Value() {
|
||||||
args = append(args, "-t", fmt.Sprintf("%s:%s", build.Repo, arg))
|
for _, repo := range build.Repo.Value() {
|
||||||
|
args = append(args, "-t", fmt.Sprintf("%s:%s", repo, tag))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, l := range build.Labels.Value() {
|
for _, l := range build.Labels.Value() {
|
||||||
|
@ -60,7 +60,7 @@ type Build struct {
|
|||||||
Pull bool // Docker build pull
|
Pull bool // Docker build pull
|
||||||
CacheFrom cli.StringSlice // Docker build cache-from
|
CacheFrom cli.StringSlice // Docker build cache-from
|
||||||
Compress bool // Docker build compress
|
Compress bool // Docker build compress
|
||||||
Repo string // Docker build repository
|
Repo cli.StringSlice // Docker build repository
|
||||||
NoCache bool // Docker build no-cache
|
NoCache bool // Docker build no-cache
|
||||||
AddHost cli.StringSlice // Docker build add-host
|
AddHost cli.StringSlice // Docker build add-host
|
||||||
Quiet bool // Docker build quiet
|
Quiet bool // Docker build quiet
|
||||||
|
Loading…
Reference in New Issue
Block a user