Hacker News new | ask | show | jobs
by dreyfiz 2816 days ago
Yeah, do you have a composer.json in the root of your repo? Buildpack will detect a PHP app...
1 comments

I have the feeling that the detect phase is absolutely orthogonal to delivering what should basically be an executable package.

What is the rationale behind having the build step tied to the packaging format?

It's not tied to the packaging format. Detect is the step that decides which buildpack or buildpacks will be responsible for constructing the image from the sourcecode.

Typically this means that buildpacks look for files that correspond to the relevant ecosystem. Maven buildpacks look for pom.xml. PHP buildpacks look for composer.json. Etc.

Nothing in this creates a hard binding. Detect steps may use whatever logic they need to decide on whether to signal they can work on a codebase.

Edit: in the v3 design the detect script can also provide dependency information that later steps can pick up. So for example, a JDK buildpack can say "yes, I can interpret this codebase, and I can contribute a JDK". A later buildpack can then look for this contribution as a condition, eg. the Maven buildpack can say "I will proceed if I see a pom.xml and if there is a JDK available".