Skip to content

Commit

Permalink
Merge pull request #28 from buildtool/buildkite
Browse files Browse the repository at this point in the history
bug: fixed env variables for buildkite.
  • Loading branch information
peter-svensson authored Dec 20, 2019
2 parents 98cbd63 + a5e8136 commit 53dd101
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ changelog:
sort: asc
filters:
exclude:
- 'Merge'
- '^Merge'
- '^docs:'
- '^test:'
2 changes: 1 addition & 1 deletion pkg/ci/buildkite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/ci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 12 additions & 6 deletions www/content/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,27 @@ 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"

- command: |-
${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
Expand Down

0 comments on commit 53dd101

Please sign in to comment.