Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ab2b451

Browse files
authoredMar 26, 2021
Merge pull request #865 from cloudfoundry/polish-add-to-cache
Polishing ADD_TO_CACHE
2 parents a1bbd7a + 5af13dc commit ab2b451

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed
 

‎README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,21 @@ Creating build/java-buildpack-cfd6b17.zip
157157
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:
158158

159159
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.
160+
```bash
161+
$ bundle install
162+
$ bundle exec rake clean package OFFLINE=true PINNED=true
163+
...
164+
Creating build/java-buildpack-offline-cfd6b17.zip
165+
```
160166

161-
Only packages referenced in the [`config/components.yml` file][] will be cached. Additional packages may be added using the `ADD_TO_CACHE` argument. It has to be set to the name of a `.yml` file in the [`config/` directory][]). Multiple file names may be separated by colons. This is useful to add additional JREs.
167+
Only packages referenced in the [`config/components.yml` file](config/components.yml) will be cached. Additional packages may be added using the `ADD_TO_CACHE` argument. The value of `ADD_TO_CACHE` should be set to the name of a `.yml` file in the [`config/` directory][] with the `.yml` file extension omitted (e.g. `sap_machine_jre`). Multiple file names may be separated by commas. This is useful to add additional JREs. These additional components will not be enabled by default and must be explicitly enabled in the application with the `JBP_CONFIG_COMPONENTS` environment variable.
162168

163169
```bash
164170
$ bundle install
165-
$ bundle exec rake clean package OFFLINE=true PINNED=true ADD_TO_CACHE=sap_machine_jre
171+
$ bundle exec rake clean package OFFLINE=true ADD_TO_CACHE=sap_machine_jre,ibm_jre
172+
...
173+
Caching https://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/8.0.6.26/linux/x86_64/ibm-java-jre-8.0-6.26-x86_64-archive.bin
174+
Caching https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.10/sapmachine-jre-11.0.10_linux-x64_bin.tar.gz
166175
...
167176
Creating build/java-buildpack-offline-cfd6b17.zip
168177
```

‎rakelib/dependency_cache_task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def component_ids
112112
conf = configuration('components').values.flatten.map { |component| component.split('::').last.snake_case }
113113
offline_cache = ENV['ADD_TO_CACHE']
114114
if !offline_cache.nil?
115-
offline_cache = offline_cache.split(':')
115+
offline_cache = offline_cache.split(',')
116116
(conf << offline_cache).flatten!.uniq!
117117
end
118118
conf

0 commit comments

Comments
 (0)
Please sign in to comment.