cloud-run-button icon indicating copy to clipboard operation
cloud-run-button copied to clipboard

Add Other Skip Configs

Open jamesward opened this issue 5 years ago • 12 comments
trafficstars

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
    }

jamesward avatar Apr 09 '20 17:04 jamesward

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

ahmetb avatar Apr 09 '20 21:04 ahmetb

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.

jamesward avatar Apr 09 '20 21:04 jamesward

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 avatar Apr 09 '20 21:04 ahmetb

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.

ahmetb avatar Apr 09 '20 21:04 ahmetb

Yeah. So:

    "build": {
        "docker": false
    }
    "build": {
        "jib": false
    }
    "build": {
        "pack": false
    }

jamesward avatar Apr 09 '20 21:04 jamesward

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 avatar Apr 09 '20 21:04 ahmetb

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

ahmetb avatar Apr 09 '20 21:04 ahmetb

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

jamesward avatar Apr 09 '20 21:04 jamesward

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

ahmetb avatar Apr 09 '20 21:04 ahmetb

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

jamesward avatar Apr 09 '20 21:04 jamesward

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.

ahmetb avatar Apr 10 '20 00:04 ahmetb

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.

jamesward avatar Apr 10 '20 14:04 jamesward