Compare commits

...

5 Commits

Author SHA1 Message Date
Aman Singh 17e907c7cf Merge pull request #66 from drone/aman/fix-docker-plugin
Added option to use overriden docker config
2022-11-04 19:57:58 +05:30
Aman Singh 190fbefe91 config override 2022-11-04 19:50:04 +05:30
Aman Singh 48f6e72954 config override 2022-11-04 19:49:25 +05:30
Aman Singh 1bee1629c2 added option to use overriden docker config 2022-11-04 19:48:03 +05:30
Kyle Lemons 2d0315e6bb Add beta testcase for clarity, coverage, and regression prevention (#64) 2022-11-03 19:05:06 +05:30
2 changed files with 19 additions and 3 deletions
+9 -2
View File
@@ -90,6 +90,11 @@ func main() {
Usage: "enable auto generation of build tags",
EnvVar: "PLUGIN_AUTO_TAG",
},
cli.BoolFlag{
Name: "dockerconfig-override",
Usage: "enable auto generation of build tags",
EnvVar: "PLUGIN_DOCKERCONFIG_OVERRIDE",
},
cli.StringFlag{
Name: "auto-tag-suffix",
Usage: "the suffix of auto build tags",
@@ -196,9 +201,11 @@ func main() {
func run(c *cli.Context) error {
username := c.String("username")
noPush := c.Bool("no-push")
// use the dockerconfig present at the path instead of creating one
configOverride := c.Bool("dockerconfig-override")
// only setup auth when pushing or credentials are defined
if !noPush || username != "" {
// only setup auth when pushing or credentials are defined and docker config override is false
if (!noPush || username != "") && !configOverride {
if err := createDockerCfgFile(username, c.String("password"), c.String("registry")); err != nil {
return err
}
+10 -1
View File
@@ -100,7 +100,16 @@ func TestBuild_AutoTags(t *testing.T) {
},
},
{
name: "tag push",
name: "beta tag push",
repoBranch: "master",
commitRef: "refs/tags/v1.0.0-beta.1",
autoTagSuffix: "",
expectedTags: []string{
"1.0.0-beta.1",
},
},
{
name: "tag push with suffix",
repoBranch: "master",
commitRef: "refs/tags/v1.0.0",
autoTagSuffix: "linux-amd64",