docs icon indicating copy to clipboard operation
docs copied to clipboard

Pipeline API - how can I use plugins?

Open or-shachar opened this issue 5 years ago • 4 comments

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.

or-shachar avatar Jan 15 '20 14:01 or-shachar

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 [email protected]? 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 😊

harrietgrace avatar Jan 16 '20 06:01 harrietgrace

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

bbaga avatar Jun 15 '20 13:06 bbaga

@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?

yyc avatar Jun 17 '20 15:06 yyc

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

bbaga avatar Jun 17 '20 19:06 bbaga