mirror of
https://github.com/drone-plugins/drone-docker.git
synced 2026-06-04 10:15:30 +08:00
feat: [CI-20527]: add push-only mode to skip build and push pre-existing images (#500)
* Add push-only support * Include support for PLUGIN_NO_PUSH as well
This commit is contained in:
@@ -33,7 +33,7 @@ func main() {
|
||||
cli.BoolFlag{
|
||||
Name: "dry-run",
|
||||
Usage: "dry run disables docker push",
|
||||
EnvVar: "PLUGIN_DRY_RUN",
|
||||
EnvVar: "PLUGIN_DRY_RUN, PLUGIN_NO_PUSH",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "remote.url",
|
||||
@@ -339,6 +339,16 @@ func main() {
|
||||
Usage: "additional cosign parameters (e.g., annotations, flags)",
|
||||
EnvVar: "PLUGIN_COSIGN_PARAMS",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "push-only",
|
||||
Usage: "skip build and only push images",
|
||||
EnvVar: "PLUGIN_PUSH_ONLY",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "source-image",
|
||||
Usage: "source image to tag and push (format: repo:tag)",
|
||||
EnvVar: "PLUGIN_SOURCE_IMAGE",
|
||||
},
|
||||
}
|
||||
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
@@ -419,6 +429,8 @@ func run(c *cli.Context) error {
|
||||
Password: c.String("cosign.password"),
|
||||
Params: c.String("cosign.params"),
|
||||
},
|
||||
PushOnly: c.Bool("push-only"),
|
||||
SourceImage: c.String("source-image"),
|
||||
}
|
||||
|
||||
if c.Bool("tags.auto") {
|
||||
|
||||
Reference in New Issue
Block a user