cloudfoundry / buildpack-packager

Buildpack Packager
Apache License 2.0
23 stars 31 forks source link

How to create a very simple build pack #22

Closed jaisonpjohn closed 4 years ago

jaisonpjohn commented 5 years ago

All I need to do in the buildpack is, echo "$KAFKA_TRUSTSTORE_CERT" | base64 --decode > $BUILD_DIR/BOOT-INF/classes/kafka.truststore.jks

My application is expecting a file which contains some confidential info. I could pass that as environment variable. This buildpack will read that env variable and write to local file system. I need a simple minimal buildpack for wrapping just this function. how can I do that

cf-gitbot commented 5 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/168657590

The labels on this github issue will be updated when the story is started.

zmackie commented 5 years ago

https://docs.cloudfoundry.org/buildpacks/custom.html has docs that could help you

jaisonpjohn commented 5 years ago

@Zanadar No, it doesnt, otherwise I wouldnt bother to raise an issue here. I am new to CloudFoundry, I couldnot find a single document mentioning how to create a simple buildpack which invokes a shell script

cf-gitbot commented 5 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/168764016

The labels on this github issue will be updated when the story is started.

zmackie commented 5 years ago

@jaisonpjohn Apologies, I didn't intend to be dismissive. Buildpacks can be confusing at first. Basically . you need a bin/ directory with bin/detect, bin/supply, and bin/finalize executable scripts. Detect should exit 0, supply should do you thing, and finalize does nothing.

https://docs.cloudfoundry.org/buildpacks/understand-buildpacks.html has better docs. I'll add more information and an example in a bit.

jaisonpjohn commented 5 years ago

@Zanadar No worries, I did not feel it as dismissive, its all good. Thanks for the info.

dfreilich commented 4 years ago

Hey @jaisonpjohn , I hope that the above helped! I'm going to close the issue, but feel free to reopen, or engage with us on the cloud foundry slack if you need more help writing a buildpack!