mirror of
https://github.com/thegeeklab/drone-docker-buildx.git
synced 2024-11-16 17:40:39 +00:00
fix secrets format
This commit is contained in:
parent
c7c3ad6942
commit
9dcea580f2
@ -112,7 +112,8 @@ steps:
|
|||||||
from_secret: secure_token
|
from_secret: secure_token
|
||||||
settings:
|
settings:
|
||||||
secrets:
|
secrets:
|
||||||
- "id=raw_file_secret,src=file.txt"
|
- "id=raw_file_secret\\\\,src=file.txt"
|
||||||
|
- 'id=other_raw_file_secret\\,src=other_file.txt'
|
||||||
- "id=SECRET_TOKEN"
|
- "id=SECRET_TOKEN"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -321,12 +321,12 @@ func settingsFlags(settings *plugin.Settings, category string) []cli.Flag {
|
|||||||
Destination: &settings.Build.SBOM,
|
Destination: &settings.Build.SBOM,
|
||||||
Category: category,
|
Category: category,
|
||||||
},
|
},
|
||||||
&cli.StringSliceFlag{
|
&cli.GenericFlag{
|
||||||
Name: "secrets",
|
Name: "secrets",
|
||||||
EnvVars: []string{"PLUGIN_SECRETS"},
|
EnvVars: []string{"PLUGIN_SECRETS"},
|
||||||
Usage: "exposes secrets to the build",
|
Usage: "exposes secrets to the build",
|
||||||
Destination: &settings.Build.Secrets,
|
Value: &drone.StringSliceFlag{},
|
||||||
Category: category,
|
Category: category,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,13 @@ func run(settings *plugin.Settings) cli.ActionFunc {
|
|||||||
|
|
||||||
settings.Build.CacheFrom = cacheFrom.Get()
|
settings.Build.CacheFrom = cacheFrom.Get()
|
||||||
|
|
||||||
|
secrets, ok := ctx.Generic("secrets").(*drone.StringSliceFlag)
|
||||||
|
if !ok {
|
||||||
|
return fmt.Errorf("%w: failed to read secrets input", ErrTypeAssertionFailed)
|
||||||
|
}
|
||||||
|
|
||||||
|
settings.Build.Secrets = secrets.Get()
|
||||||
|
|
||||||
plugin := plugin.New(
|
plugin := plugin.New(
|
||||||
*settings,
|
*settings,
|
||||||
urfave.PipelineFromContext(ctx),
|
urfave.PipelineFromContext(ctx),
|
||||||
|
@ -160,7 +160,7 @@ func commandBuild(build Build, dryrun bool) *execabs.Cmd {
|
|||||||
args = append(args, "--sbom", build.SBOM)
|
args = append(args, "--sbom", build.SBOM)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, secret := range build.Secrets.Value() {
|
for _, secret := range build.Secrets {
|
||||||
args = append(args, "--secret", secret)
|
args = append(args, "--secret", secret)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ type Build struct {
|
|||||||
Labels cli.StringSlice // Docker build labels
|
Labels cli.StringSlice // Docker build labels
|
||||||
Provenance string // Docker build provenance attestation
|
Provenance string // Docker build provenance attestation
|
||||||
SBOM string // Docker build sbom attestation
|
SBOM string // Docker build sbom attestation
|
||||||
Secrets cli.StringSlice // Docker build secrets
|
Secrets []string // Docker build secrets
|
||||||
}
|
}
|
||||||
|
|
||||||
// Settings for the Plugin.
|
// Settings for the Plugin.
|
||||||
|
Loading…
Reference in New Issue
Block a user