You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,39 @@ To learn how to configure various properties of the buildpack, follow the "Confi
66
66
* [Java Test Applications](https://github.com/cloudfoundry/java-test-applications)
67
67
* [Java Buildpack System Tests](https://github.com/cloudfoundry/java-buildpack-system-test)
68
68
69
+
## Building Packages
70
+
The buildpack can be packaged up so that it can 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.
71
+
72
+
### Online Package
73
+
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:
74
+
75
+
```bash
76
+
bundle install
77
+
bundle exec rake package
78
+
...
79
+
Creating build/java-buildpack-cfd6b17.tar.gz
80
+
```
81
+
82
+
### Offline Package
83
+
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:
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:
94
+
95
+
```bash
96
+
bundle install
97
+
bundle exec rake package VERSION=2.1
98
+
...
99
+
Creating build/java-buildpack-2.1.tar.gz
100
+
```
101
+
69
102
## Running Tests
70
103
To run the tests, do the following:
71
104
@@ -82,9 +115,11 @@ bundle exec rake
82
115
## License
83
116
This buildpack is released under version 2.0 of the [Apache License][].
Copy file name to clipboardExpand all lines: docs/extending-caches.md
+2-14Lines changed: 2 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
# Caches
2
-
Many components will want to cache large files that are downloaded for applications. The buildpack provides a cache abstraction to encapsulate this caching behavior. The cache abstraction is comprised of three cache types each with the same signature.
2
+
Many components will want to cache large files that are downloaded for applications. The buildpack provides a cache abstraction to encapsulate this caching behavior. The cache abstraction is comprised of two cache types each with the same signature.
3
3
4
4
```ruby
5
5
# Retrieves an item from the cache. Retrieval of the item uses the following algorithm:
@@ -48,7 +48,7 @@ Caching can be configured by modifying the [`config/cache.yml`][] file in the bu
48
48
| `remote_downloads` | This property can take the value `enabled` or `disabled`. <p>The default value of `enabled` means that the buildpack will check the internet connection and remember the result for the remainder of the buildpack invocation. If the internet is available, it will then be used to download files. If the internet is not available, cache will be consulted instead. <p>Alternatively, the property may be set to `disabled` which avoids the check for an internet connection, does not attempt downloads, and consults the cache instead.
49
49
50
50
## `JavaBuildpack::Util::Cache::DownloadCache`
51
-
The [`DownloadCache`][] is the most generic of the three caches. It allows you to create a cache that persists files any that write access is available. The constructor signature looks the following:
51
+
The [`DownloadCache`][] is the most generic of the two caches. It allows you to create a cache that persists files any that write access is available. The constructor signature looks the following:
52
52
53
53
```ruby
54
54
# Creates an instance of the cache that is backed by the filesystem rooted at +cache_root+
@@ -68,19 +68,7 @@ The [`ApplicationCache`][] is a cache that persists files into the application c
68
68
definitialize
69
69
```
70
70
71
-
## `JavaBuildpack::Util::Cache::GlobalCache`
72
-
The [`GlobalCache`][] is a cache that persists files into the global cache passed to all scripts. It examines `ENV['BUILDPACK_CACHE']` for the cache location and configures itself accordingly.
73
-
74
-
```ruby
75
-
# Creates an instance that is configured to use the global cache. The global cache location is defined by the
76
-
# +BUILDPACK_CACHE+ environment variable
77
-
#
78
-
#@raise if the +BUILDPACK_CACHE+ environment variable is +nil+
0 commit comments