buildkite / docs

The source files for the Buildkite documentation
https://buildkite.com/docs
MIT License
46 stars 246 forks source link

Pipeline API - how can I use plugins? #607

Open or-shachar opened 4 years ago

or-shachar commented 4 years ago

Hi,

In our company use case - we have > 50 repositories that need to share the same pipeline configuration. We don't want to replicate the pipeline.yml file on all repositories, but rather control the pipeline via API.

It seems like the API does not have the same features as the pipeline.yml. For staters: I can't use plugins.

I tries to use the pipeline PATCH API to add a step like this:

{
    "steps": [
        {
            "label": "bazel-build",
            "type": "script",
            "plugins": [
                {
                    "docker#v3.5.0": {
                        "image": "l.gcr.io/google/bazel:2.0.0",
                        "command": ["bazel",  "build", "//..." ]
                    }
                }
            ]
        }
    ]
}

I got 200 OK result but calling GET on the same pipeline showed that it ignored the plugins property.

harrietgrace commented 4 years ago

Hey @or-shachar, hmm that's an odd one, sorry you've run into this issue 😔

It looks like plugins isn't even appearing as a top-level attribute in pipelines that have existing plugins 🤔I can see them appearing under env as BUILDKITE_PLUGINS, but that seems like a bug. I'll have a chat with the team and get that sorted out for you. I'll leave this issue open until it's fixed 👍🏻

If you need a workaround in the meantime, could you please shoot an email through to support@buildkite.com? I've extended your org's trial a couple of weeks so that we can make sure you get to properly test out your idea 😊

bbaga commented 4 years ago

Hello @or-shachar, did you get any feedback from the support that helped your use-case?

yyc commented 4 years ago

@harrietgrace I also brought it up in our company's (Affirm) support slack but didn't manage to get a response, but it seems relevant to this issue. Reposted below:

As I understand it, the Update Pipelines API still doesn't support YAML steps, but it seems like there is an undocumented feature of using the configuration key and passing in the entire steps YAML as a json string? Can I get some guidance on whether this will be supported going forward and the documentation just needs to catch up?

bbaga commented 4 years ago

I did similar attempts described on the mentioned thread a while back, had no luck. POST/PATCH with configuration had no effect. 🤔