buildkite-config icon indicating copy to clipboard operation
buildkite-config copied to clipboard

Allow overriding compose env for local builds

Open zzak opened this issue 5 months ago • 0 comments

Now we can write this very simple pipeline for debugging builds locally.

Buildkite::Builder.pipeline do
  require "buildkite_config"
  use Buildkite::Config::BuildContext
  use Buildkite::Config::DockerBuild
  use Buildkite::Config::RakeCommand
  use Buildkite::Config::RubyGroup

  plugin :docker_compose, "docker-compose#v4.16.0"
  plugin :artifacts, "artifacts#v1.9.3"

  build_context.setup_rubies %w(3.3)

  group do
    label "build"
    build_context.rubies.each do |ruby|
      builder ruby, compose: {
        "cli_version": "2",
        "image-name": "buildkite_base",
        "cache-from": ["buildkite_base"],
        "push": "",
        "image-repository": "",
      }
    end
  end

  build_context.rubies.each do |ruby|
    ruby_group ruby do
      rake "actioncable", task: "test:integration", retry_on: { exit_status: -1, limit: 3 }, compose: {
        "cli_version": "2",
        "pull": "",
      }, env: {
        "IMAGE_NAME": "buildkite_base",
      }
    end
  end
end

I needed this to run builds on a local VM, where I don't have access to a docker image host and a newer version of docker/compose.

zzak avatar Sep 03 '24 23:09 zzak