Skip to content

Custom buildpack showing how to add a Java agent to Cloud Foundry apps

License

Notifications You must be signed in to change notification settings

shamil2/hello-javaagent-buildpack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Hello Java Agent Buildpack

This project shows how to add a custom Java agent to a Cloud Foundry app, using a custom builpack.

Add this buildpack to your manifest:

---
applications:
- name: myapp
  memory: 1G
  random-route: true
  path: target/myapp.jar
  buildpacks:
  - https://github.com/alexandreroman/hello-javaagent-buildpack.git
  - https://github.com/cloudfoundry/java-buildpack.git

This buildpack is actually relying on the official Cloud Foundry Java Buildpack ability to support multiple buildpacks. You need to include this buildpack before the Java Buildpack.

This buildpack defines an extension which is read by the Java Buildpack when the droplet is being built.

A standard supply script will automatically download the Java agent from its repository, and then will generate a file config.yml which will be read by the Java Buildpack to add the Java agent to the command line.

As soon as you start your app, you should see this log entry:

2019-05-25T23:43:50.058+02:00 [APP/PROC/WEB/0] [OUT] Hello world, from Java Agent!

Contribute

Contributions are always welcome!

Feel free to open issues & send PR.

License

Copyright © 2019 Pivotal Software, Inc.

This project is licensed under the Apache Software License version 2.0.

About

Custom buildpack showing how to add a Java agent to Cloud Foundry apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%