Skip to content

Commit 8232473

Browse files
committed
Improve packaging of offline version. Allow for additional components in the cache
1 parent ebf9f05 commit 8232473

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,11 @@ The offline package is a version of the buildpack designed to run without access
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.
160160

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.
162+
161163
```bash
162164
$ bundle install
163-
$ bundle exec rake clean package OFFLINE=true PINNED=true
165+
$ bundle exec rake clean package OFFLINE=true PINNED=true ADD_TO_CACHE=sap_machine_jre
164166
...
165167
Creating build/java-buildpack-offline-cfd6b17.zip
166168
```

rakelib/dependency_cache_task.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ def cache_task(uri)
109109
end
110110

111111
def component_ids
112-
configuration('components').values.flatten.map { |component| component.split('::').last.snake_case }
112+
conf = configuration('components').values.flatten.map { |component| component.split('::').last.snake_case }
113+
offline_cache = ENV['ADD_TO_CACHE'].split(':')
114+
(conf << offline_cache).flatten!.uniq!
115+
conf
113116
end
114117

115118
def configuration(id)

0 commit comments

Comments
 (0)