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


Daniel Mikusa
 

On Mon, Sep 14, 2015 at 8:25 PM, Amishi Shah (amishish) <amishish(a)cisco.com>
wrote:

Hi team,

I have a requirement to run a custom script (Configure OpenAM Web Policy
Agent) as part of a PHP buildpack.
The easiest way to do this is with a `.profile.d` script. Any script you
put into the `.profile.d` folder (in the root of your application) will be
executed prior to your application starting in the runtime environment.
Just bear in mind that these scripts must run quick as they need to finish
before your application will start and your application plus the
`.profile.d` scripts all need to start within the health check timeout.


The requirement is the Web Policy Agent should have OpenJDK configured
before it runs.
That's tricky since the PHP is not going to install that for you. You
might try the multi-buildpack, configured to run the Java & PHP build packs.

https://github.com/ddollar/heroku-buildpack-multi


Could anyone please share any thoughts on how I can achieve this
requirement?
I prefer a `.profile.d` script when possible. It's lightweight and is a
shell script, so it's pretty easy to make it do what you want. If you need
to do something at staging time, then I would suggest a build pack
extension.

You could certainly write your own build pack or fork one of the existing
ones, but that's a lot more work and puts a maintenance burden on you going
forward.


I tried it as part of the custom extension, but seems like it is not
working.
Can you be more specific? Both in regards to what you tried and in regards
to what didn't work.

Dan

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.