From 9e0c99080b9c36fd5c29532eaba0add3e1ec4c38 Mon Sep 17 00:00:00 2001 From: psyntium Date: Fri, 18 Mar 2016 21:47:22 +0800 Subject: [PATCH] updated readme --- .gitignore | 1 + .gitmodules | 3 ++ README.md | 93 +++++++---------------------------------------------- 3 files changed, 15 insertions(+), 82 deletions(-) diff --git a/.gitignore b/.gitignore index 37084deb4..06a9c62ab 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ log/ *.project /compile-extensions *.gitignore~ +*.gitmodules~ diff --git a/.gitmodules b/.gitmodules index e69de29bb..fc138b56f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "compile-extensions"] +path = compile-extensions +url = https://github.com/cloudfoundry/compile-extensions.git diff --git a/README.md b/README.md index 37952e488..7439c3ba6 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Cloud Foundry Node.js Buildpack +# Custom Node.js with Oracle's JDK 8 Buildpack [![CF Slack](https://s3.amazonaws.com/buildpacks-assets/buildpacks-slack.svg)](http://slack.cloudfoundry.org) -A Cloud Foundry [buildpack](http://docs.cloudfoundry.org/buildpacks/) for Node based apps. +A Custom Buildpack [buildpack](http://docs.cloudfoundry.org/buildpacks/) for Node.js based apps with Oracle's JDK 8 installed. -This is based on the [Heroku buildpack] (https://github.com/heroku/heroku-buildpack-nodejs). +This is based on the Cloud Foundry Node.js buildpack [buildpack](http://docs.cloudfoundry.org/buildpacks/) which is also based on the [Heroku buildpack] (https://github.com/heroku/heroku-buildpack-nodejs). Additional documentation can be found at the [CloudFoundry.org](http://docs.cloudfoundry.org/buildpacks/). @@ -12,81 +12,18 @@ Additional documentation can be found at the [CloudFoundry.org](http://docs.clou This buildpack will get used if you have a `package.json` file in your project's root directory. ```bash -cf push my_app -b https://github.com/cloudfoundry/buildpack-nodejs.git +cf push my_app -b https://github.com/syahrul-aiman/nodejs-java-buildpack.git ``` -## Disconnected environments -To use this buildpack on Cloud Foundry, where the Cloud Foundry instance limits some or all internet activity, please read the [Disconnected Environments documentation](https://github.com/cf-buildpacks/buildpack-packager/blob/master/doc/disconnected_environments.md). - -### Vendoring app dependencies -As stated in the [Disconnected Environments documentation](https://github.com/cf-buildpacks/buildpack-packager/blob/master/doc/disconnected_environments.md), your application must 'vendor' it's dependencies. - -For the NodeJS buildpack, use ```npm```: - -```shell -cd -npm install # vendors into /node_modules -``` - -```cf push``` uploads your vendored dependencies. - -### Additional extensions -In cached mode, [use the semver node_module](bin/compile#L30-32) (as opposed to http://semver.io) to resolve the correct node version. The semver.io service has an additional preference for stable versions not present in the node module version. We wrap the node module using [lib/version_resolver.js](lib/version_resolver.js) to add back this functionality. - -## Building -1. Make sure you have fetched submodules - - ```bash - git submodule update --init - ``` -1. Get latest buildpack dependencies - - ```shell - BUNDLE_GEMFILE=cf.Gemfile bundle - ``` - -1. Build the buildpack - - ```shell - 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 - - ```bash - cf create-buildpack custom_node_buildpack node_buildpack-offline-custom.zip 1 - cf push my_app -b custom_node_buildpack - ``` - -## Supported binary dependencies - -The buildpack only supports the stable patches for each dependency listed in the [manifest.yml](manifest.yml) and [releases page](https://github.com/cloudfoundry/nodejs-buildpack/releases). - - -If you try to use a binary that is not currently supported, staging your app will fail and you will see the following error message: - -``` - Could not get translated url, exited with: DEPENDENCY_MISSING_IN_MANIFEST: ... - ! - ! exit - ! -Staging failed: Buildpack compilation step failed -``` - -## Testing -Buildpacks use the [Machete](https://github.com/cloudfoundry/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 +In order to use the JAVA, Node.js needs to use child_process and execute the JAVA command such as: +```bash +const exec = require('child_process').exec; +exec("java lib/HelloWorld.jar", {shell: '/bin/bash'}, function (err, stdout, stderr) { + console.log(stderr); + console.log(stdout); +}); ``` -More options can be found on Machete's [Github page.](https://github.com/cloudfoundry/machete) - - ## Options ### Specify a node version @@ -111,15 +48,7 @@ Set engines.node in package.json to the semver range Find our guidelines [here](./CONTRIBUTING.md). -## 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](https://www.pivotaltracker.com/projects/1042066)