Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default functionality & refactor packaging #957

Merged
merged 4 commits into from
Jul 28, 2022
Merged

Add default functionality & refactor packaging #957

merged 4 commits into from
Jul 28, 2022

Conversation

dmikusa
Copy link
Contributor

@dmikusa dmikusa commented Jul 15, 2022

  1. Adds an environment variable that can be used by operations teams to set default values. Operator defaults override buildpack defaults, but are overridden by application developer values. Operator defaults are set by exposing an environment variable of the pattern JBP_DEFAULT_<config-file>='<inline-yaml>'. So to set a default Java version, JBP_DEFAULT_OPEN_JDK_JRE='{ jre: { version: 11.+ }}'.

  2. Adds config/packaging.yml. This contains the list of component data. Each component gets a name, CVE notes link and release notes link. This information is used by the rake versions command to generate a nice set of release notes for each package. This information was refactored out of the scripts (was previously hard-coded).

  3. Each config/<jre>.yml file has been given a jre.version_lines property. This is a list of the supported version lines for that JRE. It defaults to using pattern matching to pick the latest 1.8, 11 and 17 versions. If you are packaging your own version of the buildpack and want to limit the version lines included, perhaps to reduce the size of the generated buildpack file, you can edit this list and remove entries. Theh package script will only include what is listed in this array.

  4. When pinning versions, the packaging script will now update each config/<jre>yml file's jre.version_lines list with the pinned versions, in addition to jre.version. This allows you to have a list of every version line bundled with the buildpack when a release is cut (previously, only 1.8 was committed to source control). This helps when rebuilding a version of the Java buildpack at a later date, as you'll have the exact set of Java versions which should be included.

  5. You may change the default version of Java that is selected during a build of the Java buildpack by setting the config/<jre>.yml file's jre.version value. This needs to match one of the entries in jre.version_lines. Then follow the standard packaging steps the the buildpack that's generated will use the selected version of Java by default.

Resolves #938 #892 #886

Signed-off-by: Daniel Mikusa dmikusa@vmware.com

README.md Outdated Show resolved Hide resolved
Daniel Mikusa added 4 commits July 25, 2022 13:56
1. Adds an environment variable that can be used by operations teams to set default values. Operator defaults override buildpack defaults, but are overridden by application developer values. Operator defaults are set by exposing an environment variable of the pattern `JBP_DEFAULT_<config-file>='<inline-yaml>'`. So to set a default Java version, `JBP_DEFAULT_OPEN_JDK_JRE='{ jre: { version: 11.+ }}'`.

2. Adds `config/packaging.yml`. This contains the list of component data. Each component gets a name, CVE notes link and release notes link. This information is used by the `rake versions` command to generate a nice set of release notes for each package. This information was refactored out of the scripts (was previously hard-coded).

3. Each `config/<jre>.yml` file has been given a `jre.version_lines` property. This is a list of the supported version lines for that JRE. It defaults to using pattern matching to pick the latest 1.8, 11 and 17 versions. If you are packaging your own version of the buildpack and want to limit the version lines included, perhaps to reduce the size of the generated buildpack file, you can edit this list and remove entries. Theh package script will only include what is listed in this array.

4. When pinning versions, the packaging script will now update each `config/<jre>yml` file's `jre.version_lines` list with the pinned versions, in addition to `jre.version`. This allows you to have a list of every version line bundled with the buildpack when a release is cut (previously, only 1.8 was committed to source control). This helps when rebuilding a version of the Java buildpack at a later date, as you'll have the exact set of Java versions which should be included.

5. You may change the default version of Java that is selected during a build of the Java buildpack by setting the `config/<jre>.yml` file's `jre.version` value. This needs to match one of the entries in `jre.version_lines`. Then follow the standard packaging steps the the buildpack that's generated will use the selected version of Java by default.

Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
- The packaging script was hard coded to use open_jdk_jre. This commit expands it to work with any component ending in _jre, so all of the existing JREs.
- This commit also updates the version lines for the non-default JREs which don't all support 8, 11, and 17.

Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
@dmikusa dmikusa merged commit 5fe41f8 into main Jul 28, 2022
@dmikusa dmikusa deleted the dep-improvs branch July 28, 2022 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Allow offline builds to choose included java versions
2 participants