Issue
I am deploying a Java Spring app to PCF and need it to automatically bind to a few user-provided services. However, for a few reasons, I need to provide a "binding name" to the service so that the app references the binding name, not the actual name of the service. Is there a way in the manifest.yml file to programmatically assign a binding name when the app is deployed?
** Here is the abbreviated manifest.yml file -- I'd like to bind the app to use "credential service-v1", but with a binding name of "credential-service".
services:
- credential-service-v1
I tried looking here but couldn't find exactly what I needed
Solution
At the time of writing this, I do not believe that's possible with just manifest.yml
. The support of service binding is pretty weak in manifest.yml
. Again, at the time of writing this it's just a list of service instance names that you want to bind to.
https://docs.run.pivotal.io/devguide/deploy-apps/manifest-attributes.html#services-block
If you want to do more complicated things like have a service binding name or say pass service specific configuration parameters, you have to use the cf cli or the API directly.
My suggestion would be to cobble together a short shell or Powershell script that drives your deployment. You'll probably want to cf push --no-start
to get things going, then you can cf bind-service
and any run any other app configuration commands, then finish up with cf start
to stage and run the app.
Answered By - Daniel Mikusa
Answer Checked By - Gilberto Lyons (JavaFixing Admin)