From 0ce7b0dc09c7ac09cca5c5fe99ca7af10ad38ee8 Mon Sep 17 00:00:00 2001 From: AnnaAAL <97691430+AnnaAAL@users.noreply.github.com> Date: Wed, 18 Jan 2023 12:24:17 +0200 Subject: [PATCH 1/2] Adding platforms variable Allowing usage of different platforms for offlinization bundling of the buildpack. --- rakelib/package.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rakelib/package.rb b/rakelib/package.rb index 5e38fbfbe1..132540d867 100644 --- a/rakelib/package.rb +++ b/rakelib/package.rb @@ -73,7 +73,14 @@ def self.version BUILDPACK_VERSION = JavaBuildpack::BuildpackVersion.new(false).freeze - PLATFORMS = %w[bionic jammy].freeze + PLATFORMS = %w[] + platform_var = ENV.fetch('PLATFORMS', 'bionic') + if platform_var != 'bionic' + platform_var = platform_var.split(',') + (PLATFORMS << platform_var).flatten!.uniq! + else + PLATFORMS << platform_var + end STAGING_DIR = "#{BUILD_DIR}/staging".freeze From c4e4fd2cae50a2d7bf1f5aef8f1f8bf77994a9d8 Mon Sep 17 00:00:00 2001 From: AnnaAAL <97691430+AnnaAAL@users.noreply.github.com> Date: Wed, 18 Jan 2023 12:44:20 +0200 Subject: [PATCH 2/2] Update README.md Add information to the Offline package section for PLATFORMS variable. --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 4f29fe943f..7ee776963a 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,17 @@ Caching https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.10/s Creating build/java-buildpack-offline-cfd6b17.zip ``` +Different platforms can be selected using the `PLATFORMS` arguments. Supported values of `PLATFORMS` are **bionic** for cflinuxfs3 and **jammy** for cflinuxfs4. The default value is **bionic**. + +```bash +$ bundle exec rake clean package OFFLINE=true ADD_TO_CACHE=sap_machine_jre PLATFORMS=jammy,bionic +... +Caching https://java-buildpack.cloudfoundry.org/google-stackdriver-debugger/jammy/x86_64/index.yml +Caching https://java-buildpack.cloudfoundry.org/google-stackdriver-debugger/bionic/x86_64/index.yml +... +Creating build/java-buildpack-offline-v*.**.zip +``` + ### Package Versioning 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=` argument: