From a5e81366d6ac66f5c809f83683d3f09bddcd6342 Mon Sep 17 00:00:00 2001 From: Peter Svensson Date: Fri, 20 Dec 2019 09:01:13 +0100 Subject: [PATCH] bug: fixed env variables for buildkite. also updated documentation of how to use the buildtools docker image --- .goreleaser.yml | 2 +- pkg/ci/buildkite.go | 2 +- pkg/config/ci_test.go | 2 +- www/content/ci.md | 18 ++++++++++++------ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index f21a5869..389137d0 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -93,6 +93,6 @@ changelog: sort: asc filters: exclude: - - 'Merge' + - '^Merge' - '^docs:' - '^test:' diff --git a/pkg/ci/buildkite.go b/pkg/ci/buildkite.go index e18f595d..38ab2440 100644 --- a/pkg/ci/buildkite.go +++ b/pkg/ci/buildkite.go @@ -4,7 +4,7 @@ type Buildkite struct { *Common CICommit string `env:"BUILDKITE_COMMIT"` CIBuildName string `env:"BUILDKITE_PIPELINE_SLUG"` - CIBranchName string `env:"BUILDKITE_BRANCH_NAME"` + CIBranchName string `env:"BUILDKITE_BRANCH"` } var _ CI = &Buildkite{} diff --git a/pkg/config/ci_test.go b/pkg/config/ci_test.go index 1d4a1827..39f2ba18 100644 --- a/pkg/config/ci_test.go +++ b/pkg/config/ci_test.go @@ -97,7 +97,7 @@ func TestCommit_VCS_Fallback_Azure(t *testing.T) { func TestIdentify_Buildkite(t *testing.T) { defer pkg.SetEnv("BUILDKITE_COMMIT", "abc123")() defer pkg.SetEnv("BUILDKITE_PIPELINE_SLUG", "reponame")() - defer pkg.SetEnv("BUILDKITE_BRANCH_NAME", "feature/first test")() + defer pkg.SetEnv("BUILDKITE_BRANCH", "feature/first test")() out := &bytes.Buffer{} cfg, err := Load(name, out) diff --git a/www/content/ci.md b/www/content/ci.md index 3b8562bd..5a6a8ce4 100644 --- a/www/content/ci.md +++ b/www/content/ci.md @@ -27,14 +27,14 @@ steps: build push label: build - + plugins: + - docker#v3.3.0: + image: buildtool/build-tools + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + propagate-environment: true - wait - - command: |- - ${BUILD_TOOLS_PATH}/deploy staging - label: Deploy to staging - branches: "master" - - block: ":rocket: Release PROD" branches: "master" @@ -42,6 +42,12 @@ steps: ${BUILD_TOOLS_PATH}/deploy prod label: Deploy PROD branches: "master" + plugins: + - docker#v3.3.0: + image: buildtool/build-tools + volumes: + - "/var/run/docker.sock:/var/run/docker.sock" + propagate-environment: true ``` ### Gitlab CI