mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-21 13:50:39 +00:00
feat: add output
option to set the export action for build results (#71)
This commit is contained in:
parent
25c057585e
commit
ee13dd891e
@ -142,6 +142,9 @@ pull_image
|
||||
compress
|
||||
: enables compression og the build context using gzip
|
||||
|
||||
output
|
||||
: sets output folder for build artifacts (format: `path` or `type=TYPE[,KEY=VALUE]`)
|
||||
|
||||
repo
|
||||
: sets repository name for the image
|
||||
|
||||
|
@ -150,6 +150,12 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag {
|
||||
Usage: "enables suppression of the build output",
|
||||
Destination: &settings.Build.Quiet,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "output",
|
||||
EnvVars: []string{"PLUGIN_OUTPUT"},
|
||||
Usage: "sets build output folder",
|
||||
Destination: &settings.Build.Output,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "target",
|
||||
EnvVars: []string{"PLUGIN_TARGET"},
|
||||
|
@ -84,7 +84,7 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd {
|
||||
}
|
||||
|
||||
args = append(args, build.Context)
|
||||
if !dryrun && len(build.Tags.Value()) > 0 {
|
||||
if !dryrun && build.Output == "" && len(build.Tags.Value()) > 0 {
|
||||
args = append(args, "--push")
|
||||
}
|
||||
if build.Compress {
|
||||
@ -114,6 +114,9 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd {
|
||||
if build.Quiet {
|
||||
args = append(args, "--quiet")
|
||||
}
|
||||
if build.Output != "" {
|
||||
args = append(args, "--output", build.Output)
|
||||
}
|
||||
|
||||
if len(build.Platforms.Value()) > 0 {
|
||||
args = append(args, "--platform", strings.Join(build.Platforms.Value()[:], ","))
|
||||
|
@ -59,6 +59,7 @@ type Build struct {
|
||||
NoCache bool // Docker build no-cache
|
||||
AddHost cli.StringSlice // Docker build add-host
|
||||
Quiet bool // Docker build quiet
|
||||
Output string // Docker build output folder
|
||||
}
|
||||
|
||||
// Settings for the Plugin.
|
||||
|
Loading…
Reference in New Issue
Block a user