Re: Question on Custom script working as part of PHP buildpack

Alexander Lomov <alexander.lomov@...>

Hey, Amishi.

I’m not sure that customizing PHP buildpack in this case is a good idea, but if you want to try - here are the steps:

1. You’ll need to add JDK, tomcat and Policy Agent .jar file to the buildpack (as it comes from Agent's docs [1]). In order to do it you’ll better add binaries to S3 and use buildpack-packager [2] to fetch them during compilation. You can take a look on the scripts I wrote to automate this task [3].
2. During compile phase this binaries should be placed to droplet with your app. You can pass settings for Policy Agent through environment variables and render config during this phase.
3. Than you’ll need to make release script to output command to run both PHP app and Policy Agent.

The last step implies running multiple threads in context of one container and I’m not sure that it can work well, the discussion of this problem was raised before several times [4].

This is the main reason to run Policy Agent as a separate Cloud Foundry application. Still I am not sure that standard Java buildpack will suite your needs. Pretty sure that it will be easier in your case to write your custom buildpack. I wrote a blogpost that can help you to understand better how to do it [5].


Best Regards,
Alex L.

On Sep 15, 2015, at 3:25 AM, Amishi Shah (amishish) <amishish(a)<mailto:amishish(a)>> wrote:

Hi team,

I have a requirement to run a custom script (Configure OpenAM Web Policy Agent) as part of a PHP buildpack. The requirement is the Web Policy Agent should have OpenJDK configured before it runs.

Could anyone please share any thoughts on how I can achieve this requirement?

I tried it as part of the custom extension, but seems like it is not working.

Amishi Shah

Join to automatically receive all group messages.