GoogleCloudPlatform / cloud-run-button

Let anyone deploy your GitHub repos to Google Cloud Run with a single click
https://cloud.run
Apache License 2.0
526 stars 91 forks source link

Add Other Skip Configs #160

Open jamesward opened 4 years ago

jamesward commented 4 years ago

Today we have build.skip which skips all build steps but it'd be nice to be able to skip specific steps:

    "build": {
        "skipdocker": false,
        "skipjib": false,
        "skippack": false
    }
ahmetb commented 4 years ago

But these are all the same step (i.e. "build"). I don't understand how it would work since all these are mutually exclusive.

jamesward commented 4 years ago

In the case of a project I was just working on, it was detecting and running the Jib build, but I really want it to skip that one and go to Buildpacks.

ahmetb commented 4 years ago

In the case of a project I was just working on, it was detecting and running the Jib build, but I really want it to skip that one and go to Buildpacks.

that's not a "skip" concern, but more of a build method inference concern.

ahmetb commented 4 years ago

In other words, if our detection model can't figure out whether it should use Buildpacks or Jib, we should address that instead of adding more fields.

jamesward commented 4 years ago

Yeah. So:

    "build": {
        "docker": false
    }
    "build": {
        "jib": false
    }
    "build": {
        "pack": false
    }
ahmetb commented 4 years ago

Can we solve this without adding a knob, though? (I'll try my hardest to push for API change and introducing new features/behavior. :) )

Don't all buildpacks have something like Procfile, for example?

ahmetb commented 4 years ago

Also can't you just do build: { skip: true } and have a hook with pack build ?

jamesward commented 4 years ago

Yeah, I was able to work around this which was nice :) https://github.com/alexismp/pdf-merger/blob/java11cr-button/app.json

ahmetb commented 4 years ago

I'm seeing a Procfile in that repo. Should our pack detection not be picking it up the build method immediately?

jamesward commented 4 years ago

Buildpacks don't always require a Procfile so we can't rely on that.

ahmetb commented 4 years ago

But when there’s a Procfile, we can take that?

It seems like this only happens with jib vs pack currently. And I am assuming we detect Jib via some file contents?

If this is a rare case (which is currently what I am hearing) and hooks can unblock, perhaps no need to add 5 more knobs just yet.

jamesward commented 4 years ago

This particular project has Jib & Procfile and there is a possibility that a project has Dockerfile, Jib, and Buildpacks. The only viable way I see to control the decision is to allow app.json overrides. But This isn't a big priority since there is a decent work around.