Mimicking Buildkite

Buildkite is a hosted CI system with a limited feature set. These two tricks will help you seemlessly run buildkite scripts in Concourse CI:

Set the input's path to .

Because the only input to a Buildkite's job is a repo at a commit, buildkite starts the build in the context of the root of the repo under build as a starting working directory. This is in contrast to Concourse, which starts you in a parent build directory with multiple possible input and output subdirectories.

Example task config looks as follows:

- task: build
config:
platform: linux
image_resource:
type: registry-image
source:
repository: alpine
params:
PACKAGE_NAME: mypackage
inputs:
- name: code-repo
path: .
outputs:
- name: tarball
run:
path: buildkite/mybuildscript.sh

Replace buildkite-agent artifact * with resources

In buildkite, downloading and uploading "artifacts" is done through the buildkite-agent CLI, for example:

buildkite-agent artifact download image-id/* .

conversely:

buildkite-agent artifact upload "vm-ip/vm-ip.txt"

To mimick this behavior in buildkite create a docker image with an empty buildkite-agent script in $PATH, for example

#!/bin/sh
# contents of /bin/buildkite-agent
exit 0

and replace artifact downloads/uploads with respective inputs and outputs. Example job definition:

- get: code-repo
- task: build
config:
platform: linux
image_resource:
type: registry-image
source:
repository: alpine
inputs:
- name: code-repo
path: .
- name: image-id
outputs:
- name: vm-ip
params:
PACKAGE_NAME: mypackage
run:
path: buildkite/mybuildscript.sh
- put: vm-ip
params:
file: vm-ip/vm-ip.txt