Also convert cacheto to workaround
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
8a6a576334
commit
d30c0c6e99
|
@ -196,11 +196,11 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag {
|
|||
Usage: "images to consider as cache sources",
|
||||
Value: &drone.StringSliceFlag{},
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
&cli.GenericFlag{
|
||||
Name: "cache-to",
|
||||
EnvVars: []string{"PLUGIN_CACHE_TO"},
|
||||
Usage: "cache destination for the build cache",
|
||||
Destination: &settings.Build.CacheTo,
|
||||
Destination: &drone.StringSliceFlag{},
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "pull-image",
|
||||
|
|
|
@ -47,9 +47,14 @@ func run(settings *plugin.Settings) cli.ActionFunc {
|
|||
if !ok {
|
||||
return fmt.Errorf("failed to read cache-from input")
|
||||
}
|
||||
|
||||
settings.Build.CacheFrom = cacheFrom.Get()
|
||||
|
||||
cacheTo, ok := ctx.Generic("cache-to").(*drone.StringSliceFlag)
|
||||
if !ok {
|
||||
return fmt.Errorf("failed to read cache-to input")
|
||||
}
|
||||
settings.Build.CacheTo = cacheTo.Get()
|
||||
|
||||
plugin := plugin.New(
|
||||
*settings,
|
||||
urfave.PipelineFromContext(ctx),
|
||||
|
|
|
@ -81,7 +81,7 @@ func commandBuild(build Build, dryrun bool) *exec.Cmd {
|
|||
for _, arg := range build.CacheFrom {
|
||||
args = append(args, "--cache-from", arg)
|
||||
}
|
||||
for _, arg := range build.CacheTo.Value() {
|
||||
for _, arg := range build.CacheTo {
|
||||
args = append(args, "--cache-to", arg)
|
||||
}
|
||||
for _, arg := range build.ArgsEnv.Value() {
|
||||
|
|
|
@ -65,7 +65,7 @@ type Build struct {
|
|||
Output string // Docker build output
|
||||
Pull bool // Docker build pull
|
||||
CacheFrom []string // Docker build cache-from
|
||||
CacheTo cli.StringSlice // Docker build cache-to
|
||||
CacheTo []string // Docker build cache-to
|
||||
Compress bool // Docker build compress
|
||||
Repo cli.StringSlice // Docker build repository
|
||||
NoCache bool // Docker build no-cache
|
||||
|
|
Loading…
Reference in New Issue