Buildkite no longer uses AWS CodePipeline. This repository has been deprecated and is no longer maintained.
AWS CodePipeline integration for Buildkite that allows you to trigger Buildkite builds from within your CodePipeline pipelines. It consists of:
- A set of custom-action-type JSON files for you to upload via the AWS CLI, enabling you to add and configure Buildkite tasks.
- A custom checkout agent hook to override the default agent code checkout behavior to have it download code directly from the CodePipeline S3 artifact.
- aws cli tool
You can test if the cli is configured by runningaws codepipeline list-pipelines
- jq
- A Buildkite API access token with the
read_builds
andwrite_builds
scope
Create your project and steps as you normally would, but you don't need to a valid git repository URL as the source code will be downloaded via the CodePipeline's S3 bucket.
The only way to create a custom CodePipeline action type is via the aws cli. There are separate JSON files for each of the types Source
, Build
, Test
and Deploy
The following command creates a custom action type for a Buildkite Test
action:
aws codepipeline create-custom-action-type --cli-input-json file://custom-action-types/test.json
Add a new pipeline action:
Choose the type you created earlier:
Configure it with your Buildkite details:
buildkite-agent start --token xxx \
--hooks-path "$PWD/agent-hooks" \
--meta-data codepipeline=true
$ ./poll.sh "category=Test,owner=Custom,version=1,provider=Buildkite"
Polling for CodePipeline job for action-type-id 'category=Test,owner=Custom,version=1,provider=Buildkite'
Create a new release on CodePipeline, either with the "Release change" button or via the cli like so:
aws codepipeline start-pipeline-execution --name my-pipeline
Your job poller should pick up the job, create a Buildkite build, and report back on the status:
Found job. Creating build at https://api.buildkite.com/v1/organizations/myorg/projects/myproj/builds
Build #398 created - https://buildkite.com/myorg/myproj/builds/398
Acknowleding CodePipeline job (id: e3d5097b-5933-438d-af73-56d9eb0d5a41 nonce: 3)
Build is running
Build is running
Build finished
Updating CodePipeline job with 'passed' result
Your pipeline should now show the completed task, with a link to the successful Buildkite build:
🎉
See LICENSE (MIT)