sannidhi / nodejs-buildpack

Cloud Foundry buildpack for Node.js

Home Page:http://docs.cloudfoundry.org/buildpacks/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloud Foundry Node.js Buildpack

CF Slack Join us on Slack

A Cloud Foundry buildpack for Node based apps.

This is based on the [Heroku buildpack] (https://github.com/heroku/heroku-buildpack-nodejs).

Additional documentation can be found at the CloudFoundry.org.

Buildpack User Documentation

Official buildpack documentation can be found at http://docs.cloudfoundry.org/buildpacks/node/index.html).

Building the Buildpack

  1. Make sure you have fetched submodules
git submodule update --init
  1. Get latest buildpack dependencies
BUNDLE_GEMFILE=cf.Gemfile bundle
  1. Build the buildpack
BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-packager [ --cached | --uncached ]
  1. Use in Cloud Foundry

Upload the buildpack to your Cloud Foundry and optionally specify it by name

cf create-buildpack custom_node_buildpack node_buildpack-offline-custom.zip 1
cf push my_app -b custom_node_buildpack

Testing

Buildpacks use the Machete framework for running integration tests.

To test a buildpack, run the following command from the buildpack's directory:

BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-build

More options can be found on Machete's GitHub page.

Contributing

Find our guidelines here.

Help and Support

Join the #buildpacks channel in our [Slack community] (http://slack.cloudfoundry.org/)

Reporting Issues

Open an issue on this project

Active Development

The project backlog is on Pivotal Tracker

Debugging custom buildpack

  1. Mount your app in readonly mode on docker

    docker run -it -v path_to_node_app:/app2 -v /path_to_buildpack/nodejs-buildpack:/bp cloudfoundry/cflinuxfs2 bash
    
  2. Run the following command

     export CF_STACK=cflinuxfs2 && cp -r /app2 /buildDir && ./bp/bin/supply /buildDir /cache /deps 0
     

    The first command is setting up the stack, the 2nd command copies the app in a buildDir so that we can replicate the steps without changing the app directory and the last command runs the supply script with arguments build directory, cache dir and dependency dir in that order.

  3. If step 2 fails, make the nexcessary changes to the buildpack locally.

  4. Exit out of the docker shell and follow steps 1, 2 again.

About

Cloud Foundry buildpack for Node.js

http://docs.cloudfoundry.org/buildpacks/

License:MIT License


Languages

Language:Shell 46.9%Language:Ruby 38.3%Language:JavaScript 14.8%