buildkite-plugins / docker-compose-buildkite-plugin

🐳⚡️ Run build scripts, and build + push images, w/ Docker Compose
MIT License
172 stars 140 forks source link

cli-version: Fix int/string mismatch. #374

Closed toothbrush closed 1 year ago

toothbrush commented 1 year ago

Over in https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/pull/334, support was added for using Docker CLI v2.

However, i found it impossible to actually select! Here's the pipeline yaml i tried:

steps:
  - name: Build ecs-upload-task Docker
    plugins:
    - docker-compose#v4.9.0:
        cli-version: 2
        config: ecs-upload-task/docker-compose.yaml
        push: ecs-upload-task

The problem is though, the plugin.yml file specifies an "impossible schema". Note how the field is defined as requiring a string, but the only two enum options are YAML integers! My small change made it possible to actually use the plugin as intended and unblocked me.

https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/blob/fe3522acb645f4471014f4218fa7d884024f0b29/plugin.yml#L32-L36

Here's what i saw when i originally set cli-version: 2 or cli-version: "2".

image image

toothbrush commented 1 year ago

In case someone stumbles across this before the fix is merged, here was the workaround i found:

steps:
  - name: Build ecs-upload-task Docker
    plugins:
    - docker-compose#v4.9.0:
        push:
          - ecs-upload-task
    env:
      BUILDKITE_PLUGIN_DOCKER_COMPOSE_CLI_VERSION: "2"
toothbrush commented 1 year ago

What do you think?

I've taken your suggestion – thanks @toote. I also tested it out on a build i was doing, looks like it works correctly.

toothbrush commented 1 year ago

image

Um, that wasn't my intention at all when clicking the re-request button! Sorry!

toothbrush commented 1 year ago

Thanks Matías! 🙌