Skip to content

Commit

Permalink
Add support for managing pipeline team access (#43)
Browse files Browse the repository at this point in the history
Co-authored-by: justcompile <[email protected]>
  • Loading branch information
darrylb-github and justcompile authored Jun 15, 2020
1 parent bd40a66 commit 9ba7c6f
Show file tree
Hide file tree
Showing 11 changed files with 483 additions and 377 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ terraform-provider-buildkite

# GoReleaser dist
dist/

# IDE files
.idea
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ resource "buildkite_pipeline" "repo1" {
repository = "[email protected]:org/repo1"
steps = "steps:\n - command: \"buildkite-agent pipeline upload\"\n label: \":pipeline:\""
}
# create a pipeline with default upload step and assign team access
resource "buildkite_pipeline" "repo1" {
name = "repo1"
description = "a repository pipeline"
repository = "[email protected]:org/repo1"
steps = "steps:\n - command: \"buildkite-agent pipeline upload\"\n label: \":pipeline:\""
team {
slug = "everyone"
access_level = "READ_ONLY"
}
team {
slug = "developers"
access_level = "BUILD_AND_READ"
}
team {
slug = "admins"
access_level = "MANAGE_BUILD_AND_READ"
}
}
```

#### `provider` Argument reference
Expand Down
4 changes: 2 additions & 2 deletions buildkite/provider.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package buildkite

import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

// Provider creates the terraform.ResourceProvider for Buildkite
Expand Down
4 changes: 2 additions & 2 deletions buildkite/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"os"
"testing"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

var testAccProviders map[string]terraform.ResourceProvider
Expand Down
2 changes: 1 addition & 1 deletion buildkite/resource_agent_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"errors"

"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/shurcooL/graphql"
)

Expand Down
Loading

0 comments on commit 9ba7c6f

Please sign in to comment.