terraform-buildkite

command module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2020 License: MIT Imports: 2 Imported by: 0

README

Terraform provider for buildkite

Manage buildkite pipelines with Terraform!

Usage

resource "buildkite_pipeline" "eosio" {
  name                 = "EOSIO"
  repository           = "git@github.com:EOSIO/eos.git"
  slug                 = "eosio"
  branch_configuration = "master release/* develop v*.*.*"
  default_branch       = "develop"
  description          = ":muscle: The Most Powerful Infrastructure for Decentralized Applications"
  
  github_settings {
    trigger_mode = "code"
  }

  env                  =  {
    "BUILDKITE_CLEAN_CHECKOUT" = true
    "SKIP_CONTRACT_BUILDER" = true
    "PREP_COMMANDS" = <<EOF
git clone -v -- \$BUILDKITE_REPO .;
[[ \$BUILDKITE_BRANCH =~ ^pull/[0-9]+/head: ]] && git fetch -v --prune origin refs/pull/$(echo \$BUILDKITE_BRANCH | cut -d/ -f2)/head || git checkout \$BUILDKITE_BRANCH;
git checkout \$BUILDKITE_COMMIT;
git clean -ffxdq;
./.cicd/prep-submodules.sh;
    EOF
  }

  step = [
    {
      type    = "script"
      name    = ":pipeline: Pipeline Upload"
      command = <<CMD
        $$PREP_COMMANDS
        ./.cicd/generate-pipeline.sh > pipeline.yml && buildkite-agent artifact upload pipeline.yml && buildkite-agent pipeline upload pipeline.yml
      CMD
      agent_query_rules = [
        "queue=automation-basic-builder-fleet"
      ]
    },
  ]
}
  • IF you don't set github_settings or bitbucket_settings, buildkite will set true for some of the options. See the tests for an example.
  • All github_settings and bitbucket properties not defined will default to false or an empty string.

Building the plugin

./build.sh
  • Take the ./dist/terraform-provider-buildkite-*.zip file and make sure it's on the docker tag you're using:
    RUN mkdir -p "/root/.terraform.d/plugins/"
    COPY ./packages/terraform-provider-buildkite-v0.0.6-linux-amd64.zip /root/terraform-provider-buildkite-v0.0.6-linux-amd64.zip
    RUN unzip /root/terraform-provider-buildkite-v0.0.6-linux-amd64.zip -d "/root/.terraform.d/plugins/"
    RUN rm -rf /root/terraform-provider-buildkite-v0.0.6-linux-amd64.zip
    

Development & Testing

./test.sh
  • You can set export TF_LOG=DEBUG before executing the test script to get a better idea of what is failing.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL