Skip to content

Commit e4ff4e8

Browse files
committed
Merge branch 'cgfrost-76619826-document-expert-mode'
[resolves #98]
2 parents 6d68606 + 27f95d3 commit e4ff4e8

File tree

3 files changed

+64
-9
lines changed

3 files changed

+64
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ To learn how to configure various properties of the buildpack, follow the "Confi
6464
* [Repositories](docs/extending-repositories.md) ([Configuration](docs/extending-repositories.md#configuration))
6565
* [Utiltities](docs/extending-utiltities.md)
6666
* [Debugging the Buildpack](docs/debugging-the-buildpack.md)
67+
* [Buildpack Modes](docs/buildpack-modes.md)
6768
* Related Projects
6869
* [Java Buildpack Dependency Builder](https://github.com/cloudfoundry/java-buildpack-dependency-builder)
6970
* [Java Test Applications](https://github.com/cloudfoundry/java-test-applications)

docs/buildpack-modes.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Buildpack Modes
2+
The Java Buildpack has three execution modes as described in the blog post, ['Packaged and Offline Buildpacks'][l].
3+
4+
* **Easy Mode:** Uses the repository at `https://download.run.pivotal.io`. This does not require any cloning or downloading unless you want to modify the Cloud Foundry provided buildpack. This is the default, and what we recommend to anyone who asks.
5+
* **Expert Mode:** Refers to a repository hosted at a different location, possibly on an internal network. The [structure of the repository[r] is defined as an HTTP-accessible collection of files. The repository root must contain an `index.yml` file that is a mapping of concrete versions to absolute URIs. This repository can be created manually or [creating a replica](#replicating-the-repository-optional) for the repository at `https://download.run.pivotal.io`. This is what we would recommend to any customer that didn’t want to access the Internet. It’s easy to keep applications secure and up-to-date, but requires the expertise to run a web-server and keep it up to date.
6+
* **Offline Mode:** Uses only the packaged internal cache. This is what we recommend if you wanted a single, self-contained artifact. The downside is having to package and keep all your dependencies up to date.
7+
8+
9+
## Easy Mode
10+
The "Easy Mode" buildpack is included in all Cloud Foundry distributions and used by default. To configure the buildpack, refer to [Configuration and Extension][c].
11+
12+
You can also download specific versions of the buildpack to use with the `create-buildpack`, and `update-buildpack` Cloud Foundry CLI commands. To find these, navigate to the [Java Buildpack Releases page][v] and download one of the following:
13+
14+
* `java-buildpack-v<VERSION>.zip`
15+
* Source Code (zip)
16+
17+
To add the buildpack to an instance of Cloud Foundry, use the `cf create-buildpack java-buildpack java-buildpack-v<VERSION>.zip` command. For more details refer to the [Cloud Foundry buildpack documentation][b].
18+
19+
20+
## Expert Mode
21+
The "Expert Mode" buildpack is a minor fork of the default Java Buildpack. For details on configuring the buildpack, refer to [Configuration and Extension][c]. To configure the buildpack to point at an alternate repository, modify the [`config/repository.yml`][y] file to use a different `default_repository_root`.
22+
23+
```yaml
24+
# Repository configuration
25+
---
26+
default_repository_root: https://<ALTERNATE_HOST>
27+
```
28+
29+
Once the buildpack has been modified, it needs to be packaged and uploaded to the Cloud Foundry instance. In order to package the modified buildpack, refer to [Building Packages][p]. To add the buildpack to an instance of Cloud Foundry, use the `cf create-buildpack java-buildpack java-buildpack-v<VERSION>.zip` command. For more details refer to the [Cloud Foundry buildpack documentation][b].
30+
31+
### Replicating the Repository _(Optional)_
32+
The easiest way to create a fully populated internal repository is to replicate the one found at `https://download.run.pivotal.io`. The [Java Buildpack Dependency Builder][d] contains a `replicate` script that automates this process. To use the script, issue the following commands from the root directory of a clone of this repository:
33+
34+
```bash
35+
$ bundle install
36+
$ bundle exec bin/replicate [--base-uri <BASE-URI> | --host-name <HOST-NAME>] --output <OUTPUT>
37+
```
38+
39+
For details on using the `replicate script` refer to [Replicating Repository][e].
40+
41+
42+
## Offline Mode
43+
The "Offline Mode" buildpack is a self-contained packaging of either the "Easy Mode" or "Expert Mode" buildpacks.
44+
45+
You can download specific versions of the "Offline Mode" buildpack to use with the `create-buildpack` and `update-buildpack` Cloud Foundry CLI commands. To find these, navigate to the [Java Buildpack Releases page][v] and download one of the `java-buildpack-offline-v<VERSION>.zip` file. In order to package a modified "Offline Mode" buildpack, refer to [Building Packages][p]. To add the buildpack to an instance of Cloud Foundry, use the `cf create-buildpack java-buildpack java-buildpack-offline-v<VERSION>.zip` command. For more details refer to the [Cloud Foundry buildpack documentation][b].
46+
47+
48+
[b]: http://docs.pivotal.io/pivotalcf/adminguide/buildpacks.html
49+
[c]: ../README.md#configuration-and-extension
50+
[d]: https://github.com/cloudfoundry/java-buildpack-dependency-builder
51+
[e]: https://github.com/cloudfoundry/java-buildpack-dependency-builder#replicating-repository
52+
[l]: http://blog.cloudfoundry.org/2014/04/03/packaged-and-offline-buildpacks/
53+
[p]: ../README.md#building-packages
54+
[r]: https://github.com/cloudfoundry/java-buildpack/blob/master/docs/extending-repositories.md#repository-structure
55+
[v]: https://github.com/cloudfoundry/java-buildpack/releases
56+
[y]: ../config/repository.yml

java-buildpack.iml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -273,26 +273,24 @@
273273
<orderEntry type="sourceFolder" forTests="false" />
274274
<orderEntry type="library" scope="PROVIDED" name="addressable (v2.3.6, rbenv: 1.9.3-p547) [gem]" level="application" />
275275
<orderEntry type="library" scope="PROVIDED" name="ast (v2.0.0, rbenv: 1.9.3-p547) [gem]" level="application" />
276-
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.7.0, rbenv: 1.9.3-p547) [gem]" level="application" />
276+
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.7.3, rbenv: 1.9.3-p547) [gem]" level="application" />
277277
<orderEntry type="library" scope="PROVIDED" name="codeclimate-test-reporter (v0.4.0, rbenv: 1.9.3-p547) [gem]" level="application" />
278278
<orderEntry type="library" scope="PROVIDED" name="crack (v0.4.2, rbenv: 1.9.3-p547) [gem]" level="application" />
279-
<orderEntry type="library" scope="PROVIDED" name="debase (v0.0.9, rbenv: 1.9.3-p547) [gem]" level="application" />
280279
<orderEntry type="library" scope="PROVIDED" name="debugger-ruby_core_source (v1.3.5, rbenv: 1.9.3-p547) [gem]" level="application" />
281280
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.2.5, rbenv: 1.9.3-p547) [gem]" level="application" />
282281
<orderEntry type="library" scope="PROVIDED" name="docile (v1.1.5, rbenv: 1.9.3-p547) [gem]" level="application" />
283-
<orderEntry type="library" scope="PROVIDED" name="json (v1.8.1, rbenv: 1.9.3-p547) [gem]" level="application" />
284282
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.10.1, rbenv: 1.9.3-p547) [gem]" level="application" />
285-
<orderEntry type="library" scope="PROVIDED" name="parser (v2.2.0.pre.3, rbenv: 1.9.3-p547) [gem]" level="application" />
283+
<orderEntry type="library" scope="PROVIDED" name="parser (v2.2.0.pre.4, rbenv: 1.9.3-p547) [gem]" level="application" />
286284
<orderEntry type="library" scope="PROVIDED" name="powerpack (v0.0.9, rbenv: 1.9.3-p547) [gem]" level="application" />
287285
<orderEntry type="library" scope="PROVIDED" name="rainbow (v2.0.0, rbenv: 1.9.3-p547) [gem]" level="application" />
288286
<orderEntry type="library" scope="PROVIDED" name="rake (v10.3.2, rbenv: 1.9.3-p547) [gem]" level="application" />
289287
<orderEntry type="library" scope="PROVIDED" name="redcarpet (v3.1.2, rbenv: 1.9.3-p547) [gem]" level="application" />
290288
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.0.0, rbenv: 1.9.3-p547) [gem]" level="application" />
291-
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.0.3, rbenv: 1.9.3-p547) [gem]" level="application" />
292-
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.0.3, rbenv: 1.9.3-p547) [gem]" level="application" />
293-
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.0.3, rbenv: 1.9.3-p547) [gem]" level="application" />
294-
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.0.3, rbenv: 1.9.3-p547) [gem]" level="application" />
295-
<orderEntry type="library" scope="PROVIDED" name="rubocop (v0.24.1, rbenv: 1.9.3-p547) [gem]" level="application" />
289+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.0.4, rbenv: 1.9.3-p547) [gem]" level="application" />
290+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.0.4, rbenv: 1.9.3-p547) [gem]" level="application" />
291+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.0.4, rbenv: 1.9.3-p547) [gem]" level="application" />
292+
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.0.4, rbenv: 1.9.3-p547) [gem]" level="application" />
293+
<orderEntry type="library" scope="PROVIDED" name="rubocop (v0.25.0, rbenv: 1.9.3-p547) [gem]" level="application" />
296294
<orderEntry type="library" scope="PROVIDED" name="ruby-debug-base19x (v0.11.30.pre15, rbenv: 1.9.3-p547) [gem]" level="application" />
297295
<orderEntry type="library" scope="PROVIDED" name="ruby-debug-ide (v0.4.22, rbenv: 1.9.3-p547) [gem]" level="application" />
298296
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.5.1, rbenv: 1.9.3-p547) [gem]" level="application" />

0 commit comments

Comments
 (0)