This directory contains terraform configuration files to manage pipelines on Buildkite.
terraform | |- bazel # Configuration files for bazel |- bazel-testing # Configuration files for bazel-testing |- bazel-trusted # Configuration files for bazel-trusted
The terraform state is stored in GCS bucket bazel-buildkite-tf-state
(non-public).
Please follow these steps to setup your local terraform environment:
bazel-buildkite-tf-state
. Check here for more details about authentication.terraform
read the API token:export BUILDKITE_API_TOKEN=TOKEN
terraform init
in one of the configurtion directories, e.g. terraform/bazel-testing
.buildkite_pipeline
resource, e.g.:resource "buildkite_pipeline" "android-testing" { name = "Android Testing" repository = "https://github.com/googlesamples/android-testing.git" steps = templatefile("pipeline.yml.tpl", { flags = ["--file_config=bazelci/buildkite-pipeline.yml"] }) }You can check all available properties here.
terraform plan
to preview the change.terraform apply
to apply the change.buildkite_pipeline
resource.terraform plan
to preview the change.terraform apply
to apply the change.buildkite_pipeline
resource, e.g.:resource "buildkite_pipeline" "foo" { }It is recommended to name the resource with the slug of existing pipeline.
GraphQL API Integration
section of the Pipeline Settings
of that pipeline on Buildkite. e.g. UGlwZWxpbmUtLS0xYmJmYmM2NS0wMzE5LTQxMDMtOGY2Yy0zOGQ3MDQyYzVlZjc=
terraform import buildkite_pipeline.foo PIPELINE_ID
terraform plan
to see the difference and update the resource accordingly if you don't want to make the change.