Replies: 3 comments 17 replies
-
Hi there! I'll try to shed some light on the situation.
All in all, I think the git buildpack is probably a strong example for you to follow, since it detects on the presence of a certain service binding, provides/requires nothing, and then configures the build environment during its build phase. |
Beta Was this translation helpful? Give feedback.
-
For clarity, I'd add on that it sounds like you want an implementation buildpack for the custom detection/configuration settings. The detect phase of your custom implementation buildpack would be responsible for figuring out if you have the right type of app for your use case, requiring anything needed from other buildpacks like @fg-j mentioned, and then in the Then, the meta-buildpack comes into play when you want to combine your custom buildpack with the pre-existent buildpacks. No custom detection logic would live here, the detection groups are determined by the groups set up in the |
Beta Was this translation helpful? Give feedback.
-
@till That makes sense - sorry it took a couple of attempts to get on the same page. It sounds like you have a potential future path to solve your specific issue, but I additionally wanted to share that I recently encountered a similar situation as you which wouldn't be solved by supporting node-run scripts. I was working on a buildpack that would take a function (e.g. a python function) as source code and wrap it inside an application framework (e.g. flask) to create an executable. In principle, this buildpack could be as simple as:
And then I could rely on the existing Python buildpack to take this application and process it like any other application. I would add my buildpack to the beginning of the build order, in front of the Python buildpack. Unfortunately, this does not work as the various Python buildpacks fail detection due to the fact that the source code isn't a valid app (e.g. it is missing a requirements.txt) because the valid application is only present during the Build phase, not during Detect. As you know, the Detect phase runs on the same source code for all buildpacks, and one buildpack cannot influence another buildpack's Detect phase. I just wanted to share this to validate that while pre-processing / influencing downstream buildpack's detect phase is unusual - and currently unsupported - there are other use-cases for this beyond what you're looking at. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I've googled this for a fair amount of time and read lots of Golang, so I figured I come and ask here if I am on the right track.
The gist is: I am trying to build a meta buildpack with a custom detect which lets me set some variables and what not so users don't have to. Kind of like best practices that shouldn't need configuring by the users.
In order to get there, I started exploring
pack
, but too much of what I need seems to be ininternal
to make use of it and detect and build are heavily coupled. Then I started exploringpackit
for a bit and managed to build a custom detect phase for applications (kudos for that library).What I struggle with now is how I would use the result of my own detect phase to assemble already available buildpacks and provide configuration to them. It seems the return of detect is a plan, and that's (I think) one step ahead of what I want to do.
I know that I would need a list of buildpacks I want to use, that's sort of similar to what the
builder
does - not a problem. But the general use of detect seems to be that my buildpack is providing everything needed to build the application, and I would like to avoid that. Instead I would like to for example say:Originally, I wanted a
pack build --dry-run
to run a detect phase and then configurepack
with--buildpack
switches and settings. But as I said, I am not getting around in the code base. So I figured, maybe it's easier to usepackit
?It could be that I am doing this (completely) wrong, so I figured I'd ask.
Beta Was this translation helpful? Give feedback.
All reactions