Skip to content

Commit

Permalink
added the pipeline create method;
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart Auld committed Apr 16, 2018
1 parent 1f9c704 commit 3fd86b1
Show file tree
Hide file tree
Showing 9 changed files with 449 additions and 6 deletions.
23 changes: 22 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
# unused-packages = true


[[constraint]]
# use the cozero fork of go-buildkite client while we're developing this provider
name = "github.com/buildkite/go-buildkite"
branch = "master"
source = "https://github.com/cozero/go-buildkite.git"

[[constraint]]
name = "github.com/hashicorp/terraform"
version = "0.11.7"
Expand Down
10 changes: 5 additions & 5 deletions buildkite/data_source_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ func dataSourcePipeline() *schema.Resource {
Read: dataSourcePipelineRead,

Schema: map[string]*schema.Schema{
"name": &schema.Schema{
Type: schema.TypeString,
Required: true,
},
"organization": &schema.Schema{
Type: schema.TypeString,
Required: true,
Expand All @@ -24,11 +28,7 @@ func dataSourcePipeline() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"name": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Optional: true,
},

"slug": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Expand Down
14 changes: 14 additions & 0 deletions buildkite/helpers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package buildkite

// String returns a pointer to the string value passed in
func String(v string) *string {
return &v
}

// StringValue returns the value of a string pointer or "" if the pointer is nil
func StringValue(v *string) string {
if v != nil {
return *v
}
return ""
}
4 changes: 4 additions & 0 deletions buildkite/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ func Provider() terraform.ResourceProvider {
"buildkite_pipeline": dataSourcePipeline(),
},

ResourcesMap: map[string]*schema.Resource{
"buildkite_pipeline": resourcePipeline(),
},

Schema: map[string]*schema.Schema{
"api_token": &schema.Schema{
Type: schema.TypeString,
Expand Down
Loading

0 comments on commit 3fd86b1

Please sign in to comment.