terraform-provider-cloudfoundry icon indicating copy to clipboard operation
terraform-provider-cloudfoundry copied to clipboard

Allow a list of buildpacks

Open dwaynebailey opened this issue 4 years ago • 6 comments

Current configuration allows only a string for a single buildpack. But CF does allow multiple buildpacks to be specified.

The following snippet is used in one of our apps. To allow the following:

  1. Deploy a NodeJS app
  2. Install additional packages on the host using apt-buildpack
---
applications:
- name: multi-buildpack
  buildpacks:
    - https://github.com/cloudfoundry/apt-buildpack.git#v0.2.2
    - nodejs_buildpack

dwaynebailey avatar Mar 10 '20 16:03 dwaynebailey

@dwaynebailey i have the same problem.

I checked the code and see that the plugin use the v2 apis and there it was not possible. We have to think of how we can use the v3 api.

Kind regards

HappyTobi avatar Mar 18 '20 07:03 HappyTobi

@ArthurHlt I will change that with a PR but the question was:

Should everything be switched to CFv3 Api? or should we bring do that in the same way like cf cli apply multiple build packs?

CF Cli

PUT /v2/apps/<UUID>
PATCH /v3/apps/<UUID>

In the Patch request the other build packs will be assigned like described in the api description. https://v3-apidocs.cloudfoundry.org/version/3.82.0/index.html#update-an-app

Is there a way you prefer?

Kind regards

HappyTobi avatar Mar 18 '20 14:03 HappyTobi

@HappyTobi thanks for looking at this, kinda got overwhelmed with the code tbh.

I suspect this is quite invasive:

  1. The assumption that buildpack is singular is quite prevalent (though using buildpacks might allow this to happen side by side
  2. I'd guess going all out for v3 might touch too much code and doing the PUT, PATCH like the cli (didn't realise they did that) might be less effort.

dwaynebailey avatar Mar 23 '20 11:03 dwaynebailey

We can do as the cli does, do the update on the app to add more buildpacks like official cli still not use v2. We have already prepared all v3 api inside the provider already, this is used for now only for labels and annotations (see params in https://github.com/cloudfoundry-community/terraform-provider-cf/wiki/resource_space for example)

ArthurHlt avatar Mar 25 '20 09:03 ArthurHlt

Has this been updated? If so what is the correct syntax for multiple buildpacks ?

goodviber avatar Oct 22 '20 10:10 goodviber

Hi there, we are also looking forward to this feature, since we are required to use the datadog-cloudfoundry-buildpack supply buildpack. Are there any updates on this? Or is there a way around this problem?

mhubig avatar Mar 24 '22 09:03 mhubig