buildkite-plugins / docker-compose-buildkite-plugin

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

Entrypoint property not valid? #299

Closed evandam closed 3 years ago

evandam commented 3 years ago

Hi folks,

I'm trying to set the entrypoint on a step and it doesn't seem to be a valid option?

🚨 Error: /entrypoint: "" cannot match schema

My pipeline:

steps:
- label: Lint
  key: lint
  command: lint
  plugins:
    - docker-compose#v3.7.0:
        run: web
        entrypoint: "npm run"

Looking through https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/blob/master/plugin.yml it seems it was never added? Not sure if I'm missing something.

cc @emilio-notable

emilio-notable commented 3 years ago

does buildkite validate the schema automatically using the plugin.yml? if that's the case, i think you are right, it is missing that option.

What's weird to me is that we are using the entrypoint option right now, and it is not causing the schema error. We are using docker-compose#v3.6.0, and using buildkite-agent pipeline upload to define the pipeline. Maybe the pipeline upload command doesn't validate the schema?

evandam commented 3 years ago

Do you have an example pipeline that works? I have a feeling there's something weird with the combination of entrypoint and how the command is passed but I'm not sure. I'm trying something like this maybe, also dropped down to v3.6.0, also using buildkite-agent pipeline upload:

steps:
- label: Lint
  key: lint
  plugins:
    - docker-compose#v3.6.0:
        run: web-dev
        command: ["lint"]
        entrypoint: "npm run"
emilio-notable commented 3 years ago

we have something like this:

steps:
  - label: 'test'
    depends_on: 'another_step'
    timeout_in_minutes: 20
    parallelism: 3
    plugins:
      docker-compose#v3.6.0:
        run: web
        entrypoint: sh -c 'npm run test'
        pull:
          - web
        config:
          - docker-compose.yml
evandam commented 3 years ago

Strange, I just tried putting the entire command in the entrypoint like you did but still see validation errors.

Thoughts from other folks? @lox?

emilio-notable commented 3 years ago

@evandam i would recommend creating a fork of this repo and updating the plugin.yml to include the entrypoint option to see if that fixes the problem for you. I think you can pin your pipeline to use your fork changing the name to something like evandam/docker-compose#COMMIT_SHA: (see https://buildkite.com/docs/plugins/using#plugin-sources)

evandam commented 3 years ago

Hey @emilio-notable, sorry for the delay on this but just gave it a shot and it looks like it works. See https://github.com/buildkite-plugins/docker-compose-buildkite-plugin/pull/301.

Thanks!

evandam commented 3 years ago

@toolmantim can we get a new tag to use that has this change? Guessing it slipped through the cracks.

See #301