GithubHelp home page GithubHelp logo

ahilsend / terraform-buildkite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saymedia/terraform-buildkite

0.0 1.0 0.0 2.86 MB

Terraform provider for Buildkite (work in progress)

License: MIT License

Shell 10.21% Go 87.41% HTML 2.38%

terraform-buildkite's Introduction

Terraform provider for buildkite

This allows you to manage buildkite pipelines with Terraform.

Installation

Run

go get github.com/saymedia/terraform-buildkite/terraform-provider-buildkite
go install github.com/saymedia/terraform-buildkite/terraform-provider-buildkite

Which gives you a terraform-provider-buildkite in $GOPATH/bin.

Add the provider to the plugin search path in your home directory (or, in CI, the home directory of whatever user runs terraform). You'll need to make sure the program conforms to the plugin naming convention noted in the Terraform documentation linked above. (eg: terraform-provider-buildkite_vX.Y.Z)

Usage

Check provider configuration for information about how to configure the provider.

This provider manages the following resources:

Pipeline example

provider "buildkite" {
  # Get an API token from https://buildkite.com/user/api-access-tokens
  # Needs: read_pipelines, write_pipelines
  # Instead of embedding the API token in the .tf file,
  # it can also be passed via env variable BUILDKITE_API_TOKEN
  api_token    = "YOUR_API_TOKEN"
  # This is the part behind https://buildkite.com/, e.g. https://buildkite.com/some-org
  # Instead of embedding the org slug in the .tf file,
  # it can also be passed via env variable BUILDKITE_ORGANIZATION
  organization = "YOUR_ORG_SLUG"
}

resource "buildkite_pipeline" "terraform_test" {
  name       = "terraform-test"
  repository = "[email protected]:you/repo.git"

  step = [
    {
      type    = "script"
      name    = ":llama: Tests"
      command = "echo Hello world!"
    },
  ]
}

Importing existing pipelines

You can import existing pipeline definitions by their slug:

terraform import buildkite_pipeline.my_name my-pipeline-slug

Local development of this provider

To do local development you will most likely be working in a Github fork of the repository. After creating your fork you can add it as a remote on your local repository in GOPATH:

  • cd $GOPATH/src/github.com/saymedia/terraform-buildkite
  • git remote add mine [email protected]:yourname/terraform-buildkite
  • git checkout -b yourbranch
  • git push -u mine yourbranch

After this you should be able to git push to your fork, and eventually open a PR if you like.

You can build like this:

  • go install github.com/saymedia/terraform-buildkite/terraform-provider-buildkite

This should produce a file at $GOPATH/bin/terraform-provider-buildkite. To use this with Terraform you'll need to move that binary to the third-party plugins direcory to help Terraform find this file.

You can see debug output via TF_LOG=DEBUG terraform plan

terraform-buildkite's People

Contributors

ahilsend avatar apparentlymart avatar davidminor avatar joscha avatar serceman avatar toolmantim avatar zegl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.