From 6053ba488893157535dc4aa386f14e60eb31bac4 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 10 Jan 2021 23:53:07 +0100 Subject: [PATCH] chore: fix static check --- .drone.jsonnet | 12 ++++++------ .drone.yml | 26 +++++++++++++------------- docker.go | 6 +++--- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index 1a0f351..7b92801 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -67,7 +67,7 @@ local PipelineTest = { }, ], trigger: { - ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], + ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'], }, }; @@ -137,7 +137,7 @@ local PipelineBuildBinaries = { 'test', ], trigger: { - ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], + ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'], }, }; @@ -187,7 +187,7 @@ local PipelineBuildContainer(arch='amd64') = { password: { from_secret: 'docker_password' }, }, when: { - ref: ['refs/heads/master', 'refs/tags/**'], + ref: ['refs/heads/main', 'refs/tags/**'], }, depends_on: ['dryrun'], }, @@ -205,7 +205,7 @@ local PipelineBuildContainer(arch='amd64') = { password: { from_secret: 'quay_password' }, }, when: { - ref: ['refs/heads/master', 'refs/tags/**'], + ref: ['refs/heads/main', 'refs/tags/**'], }, depends_on: ['dryrun'], }, @@ -214,7 +214,7 @@ local PipelineBuildContainer(arch='amd64') = { 'test', ], trigger: { - ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'], + ref: ['refs/heads/main', 'refs/tags/**', 'refs/pull/**'], }, }; @@ -309,7 +309,7 @@ local PipelineNotifications = { 'build-container-arm64', ], trigger: { - ref: ['refs/heads/master', 'refs/tags/**'], + ref: ['refs/heads/main', 'refs/tags/**'], status: ['success', 'failure'], }, }; diff --git a/.drone.yml b/.drone.yml index dc91b3a..19c6c32 100644 --- a/.drone.yml +++ b/.drone.yml @@ -48,7 +48,7 @@ image_pull_secrets: trigger: ref: - - refs/heads/master + - refs/heads/main - refs/tags/** - refs/pull/** @@ -105,7 +105,7 @@ image_pull_secrets: trigger: ref: - - refs/heads/master + - refs/heads/main - refs/tags/** - refs/pull/** @@ -160,7 +160,7 @@ steps: from_secret: docker_username when: ref: - - refs/heads/master + - refs/heads/main - refs/tags/** depends_on: - dryrun @@ -181,7 +181,7 @@ steps: from_secret: quay_username when: ref: - - refs/heads/master + - refs/heads/main - refs/tags/** depends_on: - dryrun @@ -191,7 +191,7 @@ image_pull_secrets: trigger: ref: - - refs/heads/master + - refs/heads/main - refs/tags/** - refs/pull/** @@ -246,7 +246,7 @@ steps: from_secret: docker_username when: ref: - - refs/heads/master + - refs/heads/main - refs/tags/** depends_on: - dryrun @@ -267,7 +267,7 @@ steps: from_secret: quay_username when: ref: - - refs/heads/master + - refs/heads/main - refs/tags/** depends_on: - dryrun @@ -277,7 +277,7 @@ image_pull_secrets: trigger: ref: - - refs/heads/master + - refs/heads/main - refs/tags/** - refs/pull/** @@ -332,7 +332,7 @@ steps: from_secret: docker_username when: ref: - - refs/heads/master + - refs/heads/main - refs/tags/** depends_on: - dryrun @@ -353,7 +353,7 @@ steps: from_secret: quay_username when: ref: - - refs/heads/master + - refs/heads/main - refs/tags/** depends_on: - dryrun @@ -363,7 +363,7 @@ image_pull_secrets: trigger: ref: - - refs/heads/master + - refs/heads/main - refs/tags/** - refs/pull/** @@ -454,7 +454,7 @@ image_pull_secrets: trigger: ref: - - refs/heads/master + - refs/heads/main - refs/tags/** status: - success @@ -468,6 +468,6 @@ depends_on: --- kind: signature -hmac: 39198ae608d35d3f8b0a0a69ac66243cf31ccc4b0303b39a64b61ff738daa292 +hmac: 9ea1cc8a26d1c759eaf152bbc28abe6ec479310d6081bab4c27baefa5e2d4145 ... diff --git a/docker.go b/docker.go index 47b1a86..7bf9d44 100644 --- a/docker.go +++ b/docker.go @@ -93,7 +93,7 @@ func (p Plugin) Exec() error { path := filepath.Join(dockerHome, "config.json") err := ioutil.WriteFile(path, []byte(p.Login.Config), 0600) if err != nil { - return fmt.Errorf("Error writing config.json: %s", err) + return fmt.Errorf("error writing config.json: %s", err) } } @@ -102,7 +102,7 @@ func (p Plugin) Exec() error { cmd := commandLogin(p.Login) err := cmd.Run() if err != nil { - return fmt.Errorf("Error authenticating: %s", err) + return fmt.Errorf("error authenticating: %s", err) } } @@ -139,7 +139,7 @@ func (p Plugin) Exec() error { for _, tag := range p.Build.Tags { cmds = append(cmds, commandTag(p.Build, tag)) // docker tag - if p.Dryrun == false { + if !p.Dryrun { cmds = append(cmds, commandPush(p.Build, tag)) // docker push } }