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: buildconfig:platform: linuximage_resource:type: registry-imagesource:repository: alpineparams:PACKAGE_NAME: mypackageinputs:- name: code-repopath: .outputs:- name: tarballrun: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-agentexit 0
and replace artifact downloads/uploads with respective inputs and outputs. Example job definition:
- get: code-repo- task: buildconfig:platform: linuximage_resource:type: registry-imagesource:repository: alpineinputs:- name: code-repopath: .- name: image-idoutputs:- name: vm-ipparams:PACKAGE_NAME: mypackagerun:path: buildkite/mybuildscript.sh- put: vm-ipparams:file: vm-ip/vm-ip.txt