Giter Site home page Giter Site logo

dbuchko / anypoint-buildpack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mulesoft-consulting/anypoint-buildpack

0.0 1.0 0.0 4.19 MB

Cloud Foundry buildpack for running Java applications

License: Apache License 2.0

Ruby 98.00% Shell 1.65% Python 0.35%

anypoint-buildpack's Introduction

Cloud Foundry Anypoint Mule Runtime Buildpack

Build Status Dependency Status Code Climate Code Climate

The anypoint-buildpack is a Cloud Foundry buildpack for running Anypoint Mule-based applications.

Usage

To use this buildpack specify the URI of the repository when pushing an application to Cloud Foundry:

$ cf push <APP-NAME> -p <ARTIFACT> -b https://github.com/mulesoft-consulting/anypoint-buildpack.git

Alternatively specify the buildpack URL in the manifest.yml file, e.g.:

---

applications:

- name: helloworld

  memory: 1g

  buildpack: https://github.com/javaduke/anypoint-buildpack.git

Configuration and Extension

The buildpack supports extension through the use of Git repository forking. The easiest way to accomplish this is to use GitHub's forking functionality to create a copy of this repository. Make the required extension changes in the copy of the repository. Then specify the URL of the new repository when pushing Cloud Foundry applications. If the modifications are generally applicable to the Cloud Foundry community, please submit a pull request with the changes.

Buildpack configuration can be overridden with an environment variable matching the configuration file you wish to override minus the .yml extension and with a prefix of JBP_CONFIG. It is not possible to add new configuration properties and properties with nil or empty values will be ignored by the buildpack. The value of the variable should be valid inline yaml, referred to as flow style in the yaml spec. For example, to change the default version of Java to 7 and adjust the memory heuristics apply this environment variable to the application.

$ cf set-env my-application JBP_CONFIG_OPEN_JDK_JRE '{jre: { version: 1.7.0_+ }}'

If the key or value contains a special character such as : it should be escaped with double quotes. For example, to change the default repository path for the buildpack.

$ cf set-env my-application JBP_CONFIG_REPOSITORY '{default_repository_root: "http://repo.example.io"}'

If the key or value contains an environment variable that you want to bind at runtime you need to escape it from your shell. For example, to add command line arguments containing an environment variable to a Java Main application.

$ cf set-env my-application JBP_CONFIG_JAVA_MAIN '{arguments: "-server.port=\$PORT -foo=bar"}'

Environment variable can also be specified in the applications manifest file. For example, to specify an environment variable in an applications manifest file that disables Auto-reconfiguration.

  env:
    JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{enabled: false}'

This final example shows how to change the version of Tomcat that is used by the buildpack with an environment variable specified in the applications manifest file.

  env:
    JBP_CONFIG_TOMCAT: '{tomcat: { version: 8.0.+ }}'

See the Environment Variables documentation for more information.

To learn how to configure various properties of the buildpack, follow the "Configuration" links below. More information on extending the buildpack is available here.

Additional Documentation

Building Packages

The buildpack can be packaged up so that it can be uploaded to Cloud Foundry using the cf create-buildpack and cf update-buildpack commands. In order to create these packages, the rake package task is used.

Online Package

The online package is a version of the buildpack that is as minimal as possible and is configured to connect to the network for all dependencies. This package is about 50K in size. To create the online package, run:

$ bundle install
$ bundle exec rake package
...
Creating build/anypoint-buildpack-cfd6b17.zip

Offline Package

The offline package is a version of the buildpack designed to run without access to a network. It packages the latest version of each dependency (as configured in the config/ directory) and disables remote_downloads. This package is about 180M in size. To create the offline package, use the OFFLINE=true argument:

To pin the version of dependencies used by the buildpack to the ones currently resolvable use the PINNED=true argument. This will update the config/ directory to contain exact version of each dependency instead of version ranges.

$ bundle install
$ bundle exec rake package OFFLINE=true PINNED=true
...
Creating build/anypoint-buildpack-offline-cfd6b17.zip

Package Versioning

Keeping track of different versions of the buildpack can be difficult. To help with this, the rake package task puts a version discriminator in the name of the created package file. The default value for this discriminator is the current Git hash (e.g. cfd6b17). To change the version when creating a package, use the VERSION=<VERSION> argument:

$ bundle install
$ bundle exec rake package VERSION=2.1
...
Creating build/anypoint-buildpack-2.1.zip

Running Tests

To run the tests, do the following:

$ bundle install
$ bundle exec rake

Running Cloud Foundry locally is useful for privately testing new features.

Contributing

Pull requests are welcome; see the contributor guidelines for details.

License

This buildpack is released under version 2.0 of the Apache License.

anypoint-buildpack's People

Contributors

akirasoft1 avatar aloismayr avatar asifdxtreme avatar cgfrost avatar dmitri-gb avatar garethjevans avatar glyn avatar imod avatar jandubois avatar jgawor avatar jghiloni avatar jossy avatar juancavallotti avatar mmc2004jp avatar mrdavidlaing avatar nebhale avatar robb1e avatar scottfrederick avatar svrc avatar twoseat avatar violetagg avatar youngm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.