From 6ec525d072e0eb4156298b2081893898559d4120 Mon Sep 17 00:00:00 2001 From: Anthony Dahanne Date: Thu, 18 Apr 2024 13:44:53 -0400 Subject: [PATCH 1/2] Add Arm64 support to SAP Machine --- .github/pipeline-descriptor.yml | 103 ++++++++++++- .github/workflows/pb-update-go.yml | 2 +- .github/workflows/pb-update-jdk-11-arm-64.yml | 108 +++++++++++++ .github/workflows/pb-update-jdk-17-arm-64.yml | 108 +++++++++++++ .github/workflows/pb-update-jdk-21-arm-64.yml | 108 +++++++++++++ .github/workflows/pb-update-jdk-22-arm-64.yml | 108 +++++++++++++ .github/workflows/pb-update-jre-11-arm-64.yml | 108 +++++++++++++ .github/workflows/pb-update-jre-17-arm-64.yml | 108 +++++++++++++ .github/workflows/pb-update-jre-21-arm-64.yml | 108 +++++++++++++ .github/workflows/pb-update-jre-22-arm-64.yml | 108 +++++++++++++ README.md | 28 ++-- buildpack.toml | 145 ++++++++++++++++++ scripts/build.sh | 4 + 13 files changed, 1130 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/pb-update-jdk-11-arm-64.yml create mode 100644 .github/workflows/pb-update-jdk-17-arm-64.yml create mode 100644 .github/workflows/pb-update-jdk-21-arm-64.yml create mode 100644 .github/workflows/pb-update-jdk-22-arm-64.yml create mode 100644 .github/workflows/pb-update-jre-11-arm-64.yml create mode 100644 .github/workflows/pb-update-jre-17-arm-64.yml create mode 100644 .github/workflows/pb-update-jre-21-arm-64.yml create mode 100644 .github/workflows/pb-update-jre-22-arm-64.yml diff --git a/.github/pipeline-descriptor.yml b/.github/pipeline-descriptor.yml index c91fe21..f5d2a3e 100644 --- a/.github/pipeline-descriptor.yml +++ b/.github/pipeline-descriptor.yml @@ -2,6 +2,9 @@ github: username: ${{ secrets.JAVA_GITHUB_USERNAME }} token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} +helpers: + "bin/helper": "github.com/paketo-buildpacks/libjvm/cmd/helper" + codeowners: - path: "*" owner: "@paketo-buildpacks/java-maintainers" @@ -107,4 +110,102 @@ dependencies: repository: SapMachine tag_filter: sapmachine-(22.*) latest_by_creation_time: true - token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + +# ARM64 +- name: JDK 11 ARM64 + id: jdk + version_pattern: "11\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + glob: sapmachine-jdk-.+_linux-aarch64_bin.tar.gz + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(11.*) + latest_by_creation_time: true + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: "arm64" +- name: JRE 11 ARM64 + id: jre + version_pattern: "11\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + glob: sapmachine-jre-.+_linux-aarch64_bin.tar.gz + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(11.*) + latest_by_creation_time: true + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: "arm64" +- name: JDK 17 ARM64 + id: jdk + version_pattern: "17\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + glob: sapmachine-jdk-.+_linux-aarch64_bin.tar.gz + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(17.*) + latest_by_creation_time: true + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: "arm64" +- name: JRE 17 ARM64 + id: jre + version_pattern: "17\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + glob: sapmachine-jre-.+_linux-aarch64_bin.tar.gz + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(17.*) + latest_by_creation_time: true + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: "arm64" +- name: JDK 21 ARM64 + id: jdk + version_pattern: "21\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + glob: sapmachine-jdk-.+_linux-aarch64_bin.tar.gz + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(21.*) + latest_by_creation_time: true + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: "arm64" +- name: JRE 21 ARM64 + id: jre + version_pattern: "21\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + glob: sapmachine-jre-.+_linux-aarch64_bin.tar.gz + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(21.*) + latest_by_creation_time: true + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: "arm64" +- name: JDK 22 ARM64 + id: jdk + version_pattern: "22\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + glob: sapmachine-jdk-.+_linux-aarch64_bin.tar.gz + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(22.*) + latest_by_creation_time: true + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: "arm64" +- name: JRE 22 ARM64 + id: jre + version_pattern: "22\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + glob: sapmachine-jre-.+_linux-aarch64_bin.tar.gz + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(22.*) + latest_by_creation_time: true + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: "arm64" \ No newline at end of file diff --git a/.github/workflows/pb-update-go.yml b/.github/workflows/pb-update-go.yml index 933ebe5..df0ef0a 100644 --- a/.github/workflows/pb-update-go.yml +++ b/.github/workflows/pb-update-go.yml @@ -1,7 +1,7 @@ name: Update Go "on": schedule: - - cron: 9 2 * * 1 + - cron: 27 2 * * 1 workflow_dispatch: {} jobs: update: diff --git a/.github/workflows/pb-update-jdk-11-arm-64.yml b/.github/workflows/pb-update-jdk-11-arm-64.yml new file mode 100644 index 0000000..c654bde --- /dev/null +++ b/.github/workflows/pb-update-jdk-11-arm-64.yml @@ -0,0 +1,108 @@ +name: Update JDK 11 ARM64 +"on": + schedule: + - cron: 0 5 * * 1-5 + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.20" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest + - uses: buildpacks/github-actions/setup-tools@v5.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + arch: arm64 + glob: sapmachine-jdk-.+_linux-aarch64_bin.tar.gz + latest_by_creation_time: true + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(11.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - name: Update Buildpack Dependency + id: buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") + ARCH=${ARCH:-amd64} + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') + + if [ -z "$OLD_VERSION" ]; then + ARCH="" # empty means noarch + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") + fi + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --arch "${ARCH}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --cpe-pattern "${CPE_PATTERN:-}" \ + --cpe "${CPE:-}" \ + --purl-pattern "${PURL_PATTERN:-}" \ + --purl "${PURL:-}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" \ + --source "${SOURCE_URI}" \ + --source-sha256 "${SOURCE_SHA256}" + + git add buildpack.toml + git checkout -- . + + if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then + LABEL="semver:major" + elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then + LABEL="semver:minor" + else + LABEL="semver:patch" + fi + + echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" + echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" + env: + ARCH: arm64 + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jdk + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + SHA256: ${{ steps.dependency.outputs.sha256 }} + SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} + SOURCE_URI: ${{ steps.dependency.outputs.source }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: 11\.[\d]+\.[\d]+ + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: Bumps `JDK 11 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jdk-11-arm-64 + commit-message: |- + Bump JDK 11 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JDK 11 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade + signoff: true + title: Bump JDK 11 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-jdk-17-arm-64.yml b/.github/workflows/pb-update-jdk-17-arm-64.yml new file mode 100644 index 0000000..9c321d0 --- /dev/null +++ b/.github/workflows/pb-update-jdk-17-arm-64.yml @@ -0,0 +1,108 @@ +name: Update JDK 17 ARM64 +"on": + schedule: + - cron: 0 5 * * 1-5 + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.20" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest + - uses: buildpacks/github-actions/setup-tools@v5.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + arch: arm64 + glob: sapmachine-jdk-.+_linux-aarch64_bin.tar.gz + latest_by_creation_time: true + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(17.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - name: Update Buildpack Dependency + id: buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") + ARCH=${ARCH:-amd64} + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') + + if [ -z "$OLD_VERSION" ]; then + ARCH="" # empty means noarch + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") + fi + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --arch "${ARCH}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --cpe-pattern "${CPE_PATTERN:-}" \ + --cpe "${CPE:-}" \ + --purl-pattern "${PURL_PATTERN:-}" \ + --purl "${PURL:-}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" \ + --source "${SOURCE_URI}" \ + --source-sha256 "${SOURCE_SHA256}" + + git add buildpack.toml + git checkout -- . + + if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then + LABEL="semver:major" + elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then + LABEL="semver:minor" + else + LABEL="semver:patch" + fi + + echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" + echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" + env: + ARCH: arm64 + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jdk + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + SHA256: ${{ steps.dependency.outputs.sha256 }} + SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} + SOURCE_URI: ${{ steps.dependency.outputs.source }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: 17\.[\d]+\.[\d]+ + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: Bumps `JDK 17 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jdk-17-arm-64 + commit-message: |- + Bump JDK 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JDK 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade + signoff: true + title: Bump JDK 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-jdk-21-arm-64.yml b/.github/workflows/pb-update-jdk-21-arm-64.yml new file mode 100644 index 0000000..570a5fc --- /dev/null +++ b/.github/workflows/pb-update-jdk-21-arm-64.yml @@ -0,0 +1,108 @@ +name: Update JDK 21 ARM64 +"on": + schedule: + - cron: 0 5 * * 1-5 + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.20" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest + - uses: buildpacks/github-actions/setup-tools@v5.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + arch: arm64 + glob: sapmachine-jdk-.+_linux-aarch64_bin.tar.gz + latest_by_creation_time: true + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(21.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - name: Update Buildpack Dependency + id: buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") + ARCH=${ARCH:-amd64} + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') + + if [ -z "$OLD_VERSION" ]; then + ARCH="" # empty means noarch + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") + fi + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --arch "${ARCH}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --cpe-pattern "${CPE_PATTERN:-}" \ + --cpe "${CPE:-}" \ + --purl-pattern "${PURL_PATTERN:-}" \ + --purl "${PURL:-}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" \ + --source "${SOURCE_URI}" \ + --source-sha256 "${SOURCE_SHA256}" + + git add buildpack.toml + git checkout -- . + + if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then + LABEL="semver:major" + elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then + LABEL="semver:minor" + else + LABEL="semver:patch" + fi + + echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" + echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" + env: + ARCH: arm64 + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jdk + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + SHA256: ${{ steps.dependency.outputs.sha256 }} + SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} + SOURCE_URI: ${{ steps.dependency.outputs.source }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: 21\.[\d]+\.[\d]+ + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: Bumps `JDK 21 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jdk-21-arm-64 + commit-message: |- + Bump JDK 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JDK 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade + signoff: true + title: Bump JDK 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-jdk-22-arm-64.yml b/.github/workflows/pb-update-jdk-22-arm-64.yml new file mode 100644 index 0000000..4471506 --- /dev/null +++ b/.github/workflows/pb-update-jdk-22-arm-64.yml @@ -0,0 +1,108 @@ +name: Update JDK 22 ARM64 +"on": + schedule: + - cron: 0 5 * * 1-5 + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.20" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest + - uses: buildpacks/github-actions/setup-tools@v5.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + arch: arm64 + glob: sapmachine-jdk-.+_linux-aarch64_bin.tar.gz + latest_by_creation_time: true + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(22.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - name: Update Buildpack Dependency + id: buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") + ARCH=${ARCH:-amd64} + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') + + if [ -z "$OLD_VERSION" ]; then + ARCH="" # empty means noarch + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") + fi + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --arch "${ARCH}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --cpe-pattern "${CPE_PATTERN:-}" \ + --cpe "${CPE:-}" \ + --purl-pattern "${PURL_PATTERN:-}" \ + --purl "${PURL:-}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" \ + --source "${SOURCE_URI}" \ + --source-sha256 "${SOURCE_SHA256}" + + git add buildpack.toml + git checkout -- . + + if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then + LABEL="semver:major" + elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then + LABEL="semver:minor" + else + LABEL="semver:patch" + fi + + echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" + echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" + env: + ARCH: arm64 + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jdk + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + SHA256: ${{ steps.dependency.outputs.sha256 }} + SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} + SOURCE_URI: ${{ steps.dependency.outputs.source }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: 22\.[\d]+\.[\d]+ + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: Bumps `JDK 22 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jdk-22-arm-64 + commit-message: |- + Bump JDK 22 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JDK 22 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade + signoff: true + title: Bump JDK 22 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-jre-11-arm-64.yml b/.github/workflows/pb-update-jre-11-arm-64.yml new file mode 100644 index 0000000..0497dda --- /dev/null +++ b/.github/workflows/pb-update-jre-11-arm-64.yml @@ -0,0 +1,108 @@ +name: Update JRE 11 ARM64 +"on": + schedule: + - cron: 0 5 * * 1-5 + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.20" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest + - uses: buildpacks/github-actions/setup-tools@v5.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + arch: arm64 + glob: sapmachine-jre-.+_linux-aarch64_bin.tar.gz + latest_by_creation_time: true + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(11.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - name: Update Buildpack Dependency + id: buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") + ARCH=${ARCH:-amd64} + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') + + if [ -z "$OLD_VERSION" ]; then + ARCH="" # empty means noarch + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") + fi + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --arch "${ARCH}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --cpe-pattern "${CPE_PATTERN:-}" \ + --cpe "${CPE:-}" \ + --purl-pattern "${PURL_PATTERN:-}" \ + --purl "${PURL:-}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" \ + --source "${SOURCE_URI}" \ + --source-sha256 "${SOURCE_SHA256}" + + git add buildpack.toml + git checkout -- . + + if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then + LABEL="semver:major" + elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then + LABEL="semver:minor" + else + LABEL="semver:patch" + fi + + echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" + echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" + env: + ARCH: arm64 + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jre + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + SHA256: ${{ steps.dependency.outputs.sha256 }} + SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} + SOURCE_URI: ${{ steps.dependency.outputs.source }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: 11\.[\d]+\.[\d]+ + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: Bumps `JRE 11 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jre-11-arm-64 + commit-message: |- + Bump JRE 11 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JRE 11 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade + signoff: true + title: Bump JRE 11 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-jre-17-arm-64.yml b/.github/workflows/pb-update-jre-17-arm-64.yml new file mode 100644 index 0000000..0ee95d5 --- /dev/null +++ b/.github/workflows/pb-update-jre-17-arm-64.yml @@ -0,0 +1,108 @@ +name: Update JRE 17 ARM64 +"on": + schedule: + - cron: 0 5 * * 1-5 + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.20" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest + - uses: buildpacks/github-actions/setup-tools@v5.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + arch: arm64 + glob: sapmachine-jre-.+_linux-aarch64_bin.tar.gz + latest_by_creation_time: true + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(17.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - name: Update Buildpack Dependency + id: buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") + ARCH=${ARCH:-amd64} + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') + + if [ -z "$OLD_VERSION" ]; then + ARCH="" # empty means noarch + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") + fi + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --arch "${ARCH}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --cpe-pattern "${CPE_PATTERN:-}" \ + --cpe "${CPE:-}" \ + --purl-pattern "${PURL_PATTERN:-}" \ + --purl "${PURL:-}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" \ + --source "${SOURCE_URI}" \ + --source-sha256 "${SOURCE_SHA256}" + + git add buildpack.toml + git checkout -- . + + if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then + LABEL="semver:major" + elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then + LABEL="semver:minor" + else + LABEL="semver:patch" + fi + + echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" + echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" + env: + ARCH: arm64 + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jre + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + SHA256: ${{ steps.dependency.outputs.sha256 }} + SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} + SOURCE_URI: ${{ steps.dependency.outputs.source }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: 17\.[\d]+\.[\d]+ + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: Bumps `JRE 17 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jre-17-arm-64 + commit-message: |- + Bump JRE 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JRE 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade + signoff: true + title: Bump JRE 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-jre-21-arm-64.yml b/.github/workflows/pb-update-jre-21-arm-64.yml new file mode 100644 index 0000000..a37967e --- /dev/null +++ b/.github/workflows/pb-update-jre-21-arm-64.yml @@ -0,0 +1,108 @@ +name: Update JRE 21 ARM64 +"on": + schedule: + - cron: 0 5 * * 1-5 + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.20" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest + - uses: buildpacks/github-actions/setup-tools@v5.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + arch: arm64 + glob: sapmachine-jre-.+_linux-aarch64_bin.tar.gz + latest_by_creation_time: true + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(21.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - name: Update Buildpack Dependency + id: buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") + ARCH=${ARCH:-amd64} + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') + + if [ -z "$OLD_VERSION" ]; then + ARCH="" # empty means noarch + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") + fi + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --arch "${ARCH}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --cpe-pattern "${CPE_PATTERN:-}" \ + --cpe "${CPE:-}" \ + --purl-pattern "${PURL_PATTERN:-}" \ + --purl "${PURL:-}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" \ + --source "${SOURCE_URI}" \ + --source-sha256 "${SOURCE_SHA256}" + + git add buildpack.toml + git checkout -- . + + if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then + LABEL="semver:major" + elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then + LABEL="semver:minor" + else + LABEL="semver:patch" + fi + + echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" + echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" + env: + ARCH: arm64 + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jre + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + SHA256: ${{ steps.dependency.outputs.sha256 }} + SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} + SOURCE_URI: ${{ steps.dependency.outputs.source }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: 21\.[\d]+\.[\d]+ + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: Bumps `JRE 21 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jre-21-arm-64 + commit-message: |- + Bump JRE 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JRE 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade + signoff: true + title: Bump JRE 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-jre-22-arm-64.yml b/.github/workflows/pb-update-jre-22-arm-64.yml new file mode 100644 index 0000000..d35573e --- /dev/null +++ b/.github/workflows/pb-update-jre-22-arm-64.yml @@ -0,0 +1,108 @@ +name: Update JRE 22 ARM64 +"on": + schedule: + - cron: 0 5 * * 1-5 + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.20" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest + - uses: buildpacks/github-actions/setup-tools@v5.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + arch: arm64 + glob: sapmachine-jre-.+_linux-aarch64_bin.tar.gz + latest_by_creation_time: true + owner: SAP + repository: SapMachine + tag_filter: sapmachine-(22.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - name: Update Buildpack Dependency + id: buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") + ARCH=${ARCH:-amd64} + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') + + if [ -z "$OLD_VERSION" ]; then + ARCH="" # empty means noarch + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") + fi + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --arch "${ARCH}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --cpe-pattern "${CPE_PATTERN:-}" \ + --cpe "${CPE:-}" \ + --purl-pattern "${PURL_PATTERN:-}" \ + --purl "${PURL:-}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" \ + --source "${SOURCE_URI}" \ + --source-sha256 "${SOURCE_SHA256}" + + git add buildpack.toml + git checkout -- . + + if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then + LABEL="semver:major" + elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then + LABEL="semver:minor" + else + LABEL="semver:patch" + fi + + echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" + echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" + env: + ARCH: arm64 + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jre + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + SHA256: ${{ steps.dependency.outputs.sha256 }} + SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} + SOURCE_URI: ${{ steps.dependency.outputs.source }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: 22\.[\d]+\.[\d]+ + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: Bumps `JRE 22 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jre-22-arm-64 + commit-message: |- + Bump JRE 22 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JRE 22 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade + signoff: true + title: Bump JRE 22 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/README.md b/README.md index 99cbed0..c8a7514 100644 --- a/README.md +++ b/README.md @@ -42,25 +42,25 @@ The buildpack will do the following if a JRE is requested: ## Configuration | Environment Variable | Description | -| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `$BP_JVM_VERSION` | Configure the JVM version (e.g. `11`, `17`, `21`). The buildpack will download JDK and JRE assets that are compatible with this version of the JVM specification. Since the buildpack only ships a single version of each supported line, updates to the buildpack can change the exact version of the JDK or JRE. In order to hold the JDK and JRE versions stable, the buildpack version itself must be stable.

Buildpack releases (and the dependency versions for each release) can be found [here][bpv]. Few users will use this buildpack directly, instead consuming a language buildpack like `paketo-buildpacks/java` who's releases (and the individual buildpack versions and dependency versions for each release) can be found [here](https://github.com/paketo-buildpacks/java/releases). Finally, some users will consume builders like `paketobuildpacks/builder:base` whose releases can be found [here](https://hub.docker.com/r/paketobuildpacks/builder/tags?page=1&name=base). To determine the individual buildpack versions and dependency versions for each builder release use the [`pack inspect-builder `](https://buildpacks.io/docs/reference/pack/pack_inspect-builder/) functionality. | +| ----------------------------- |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `$BP_JVM_VERSION` | Configure the JVM version (e.g. `11`, `17`, `21`, `22`). The buildpack will download JDK and JRE assets that are compatible with this version of the JVM specification. Since the buildpack only ships a single version of each supported line, updates to the buildpack can change the exact version of the JDK or JRE. In order to hold the JDK and JRE versions stable, the buildpack version itself must be stable.

Buildpack releases (and the dependency versions for each release) can be found [here][bpv]. Few users will use this buildpack directly, instead consuming a language buildpack like `paketo-buildpacks/java` who's releases (and the individual buildpack versions and dependency versions for each release) can be found [here](https://github.com/paketo-buildpacks/java/releases). Finally, some users will consume builders like `paketobuildpacks/builder:base` whose releases can be found [here](https://hub.docker.com/r/paketobuildpacks/builder/tags?page=1&name=base). To determine the individual buildpack versions and dependency versions for each builder release use the [`pack inspect-builder `](https://buildpacks.io/docs/reference/pack/pack_inspect-builder/) functionality. | | `$BP_JVM_TYPE` | Configure the JVM type that is provided at runtime, i.e. a JDK or JRE - accepts values "JDK" or "JRE" (default). If a JRE type is requested but not available, a JDK will be provided. | | `$BPL_JVM_HEAD_ROOM` | Configure the percentage of headroom the memory calculator will allocated. Defaults to `0`. | | `$BPL_JVM_LOADED_CLASS_COUNT` | Configure the number of classes that will be loaded at runtime. Defaults to 35% of the number of classes. | | `$BPL_JVM_THREAD_COUNT` | Configure the number of user threads at runtime. Defaults to `250`. | -| `$BPL_JVM_CLASS_ADJUSTMENT` | Absolute or percentage based adjustment of the memory calculator's class count, which influences various memory settings of the JVM. This is useful when the number of classes cannot be reliably determined during build-time and workloads run into OOM situations. Defaults to `100%`. | +| `$BPL_JVM_CLASS_ADJUSTMENT` | Absolute or percentage based adjustment of the memory calculator's class count, which influences various memory settings of the JVM. This is useful when the number of classes cannot be reliably determined during build-time and workloads run into OOM situations. Defaults to `100%`. | | `$BPL_HEAP_DUMP_PATH` | Configure the location for writing heap dumps in the event of an OutOfMemoryError exception. Defaults to ``, which disables writing heap dumps. The path set must be writable by the JVM process. | -| `$BPL_JAVA_NMT_ENABLED` | Configure whether Java Native Memory Tracking (NMT) is enabled. Defaults to `true`. Set this to `false` to disable NMT functionality. | -| `$BPL_JAVA_NMT_LEVEL` | Configure the level of detail for Java Native Memory Tracking (NMT) output. Defaults to `summary`. Set this to `detail` for detailed NMT output. | -| `$BPL_JMX_ENABLED` | Configure whether Java Management Extensions (JMX) is enabled. Defaults to `false`. Set this to `true` to enable JMX functionality. | -| `$BPL_JMX_PORT` | Configure the port number for JMX. Defaults to `5000`. When running the container, this value should match the port published locally, i.e. for Docker: --publish 5000:5000 | -| `$BPL_DEBUG_ENABLED` | Configure whether remote debugging features are enabled. Defaults to `false`. Set this to `true` to enable remote debugging. | -| `$BPL_DEBUG_PORT` | Configure the port number for remote debugging. Defaults to `8000`. -| `$BPL_DEBUG_SUSPEND` | Configure whether to suspend execution until a debugger has attached. Defaults to `false`. -| `$BPL_JFR_ENABLED` | Configure whether Java Flight Recording (JFR) is enabled. If no arguments are specified via `BPL_JFR_ARGS`, the default config args `dumponexit=true,filename=/tmp/recording.jfr` are added. -| `$BPL_JFR_ARGS` | Configure custom arguments to Java Flight Recording, via a comma-separated list, e.g. `duration=10s,maxage=1m`. If any values are specified, no default args are supplied. -| `$BP_JVM_JLINK_ENABLED` | Configures whether to run the JDK's jlink tool at build time to generate a custom JRE. Defaults to `false`. If no custom args are specified, the default args are `--no-man-pages --no-header-files --strip-debug --compress=1`. -| `$BP_JVM_JLINK_ARGS` | Configure custom arguments to supply to the jlink tool. If any custom args are specified, no default args are supplied. +| `$BPL_JAVA_NMT_ENABLED` | Configure whether Java Native Memory Tracking (NMT) is enabled. Defaults to `true`. Set this to `false` to disable NMT functionality. | +| `$BPL_JAVA_NMT_LEVEL` | Configure the level of detail for Java Native Memory Tracking (NMT) output. Defaults to `summary`. Set this to `detail` for detailed NMT output. | +| `$BPL_JMX_ENABLED` | Configure whether Java Management Extensions (JMX) is enabled. Defaults to `false`. Set this to `true` to enable JMX functionality. | +| `$BPL_JMX_PORT` | Configure the port number for JMX. Defaults to `5000`. When running the container, this value should match the port published locally, i.e. for Docker: --publish 5000:5000 | +| `$BPL_DEBUG_ENABLED` | Configure whether remote debugging features are enabled. Defaults to `false`. Set this to `true` to enable remote debugging. | +| `$BPL_DEBUG_PORT` | Configure the port number for remote debugging. Defaults to `8000`. +| `$BPL_DEBUG_SUSPEND` | Configure whether to suspend execution until a debugger has attached. Defaults to `false`. +| `$BPL_JFR_ENABLED` | Configure whether Java Flight Recording (JFR) is enabled. If no arguments are specified via `BPL_JFR_ARGS`, the default config args `dumponexit=true,filename=/tmp/recording.jfr` are added. +| `$BPL_JFR_ARGS` | Configure custom arguments to Java Flight Recording, via a comma-separated list, e.g. `duration=10s,maxage=1m`. If any values are specified, no default args are supplied. +| `$BP_JVM_JLINK_ENABLED` | Configures whether to run the JDK's jlink tool at build time to generate a custom JRE. Defaults to `false`. If no custom args are specified, the default args are `--no-man-pages --no-header-files --strip-debug --compress=1`. +| `$BP_JVM_JLINK_ARGS` | Configure custom arguments to supply to the jlink tool. If any custom args are specified, no default args are supplied. | `$JAVA_TOOL_OPTIONS` | Configure the JVM launch flags | [bpv]: https://github.com/paketo-buildpacks/sap-machine/releases diff --git a/buildpack.toml b/buildpack.toml index 76ff0b3..947ab25 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -27,6 +27,14 @@ api = "0.7" type = "Apache-2.0" uri = "https://github.com/paketo-buildpacks/sap-machine/blob/main/LICENSE" +[[targets]] +os = "linux" +arch = "amd64" + +[[targets]] +os = "linux" +arch = "arm64" + [metadata] include-files = ["LICENSE", "NOTICE", "README.md", "bin/build", "bin/detect", "bin/helper", "bin/main", "buildpack.toml"] pre-package = "scripts/build.sh" @@ -274,5 +282,142 @@ api = "0.7" type = "GPL-2.0 WITH Classpath-exception-2.0" uri = "https://openjdk.java.net/legal/gplv2+ce.html" + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:11.0.23:*:*:*:*:*:*:*"] + deprecation_date = "2024-12-30T00:00:00Z" + id = "jdk" + name = "SapMachine JDK" + purl = "pkg:generic/sap-machine-jdk@11.0.23?arch=arm64" + sha256 = "blank" + source = "https://github.com/SAP/SapMachine/archive/refs/tags/sapmachine-11.0.23.tar.gz" + source-sha256 = "c091e159967c6ff5a7bc66d8f7f01d3330c6948bbf98467da5315f6c65fb7ec5" + stacks = ["*"] + uri = "https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.23/sapmachine-jdk-11.0.23_linux-aarch64_bin.tar.gz" + version = "11.0.23" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://openjdk.java.net/legal/gplv2+ce.html" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jre:11.0.23:*:*:*:*:*:*:*"] + deprecation_date = "2024-12-30T00:00:00Z" + id = "jre" + name = "SapMachine JRE" + purl = "pkg:generic/sap-machine-jre@11.0.23?arch=arm64" + sha256 = "blank" + source = "https://github.com/SAP/SapMachine/archive/refs/tags/sapmachine-11.0.23.tar.gz" + source-sha256 = "c091e159967c6ff5a7bc66d8f7f01d3330c6948bbf98467da5315f6c65fb7ec5" + stacks = ["*"] + uri = "https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.23/sapmachine-jre-11.0.23_linux-aarch64_bin.tar.gz" + version = "11.0.23" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://openjdk.java.net/legal/gplv2+ce.html" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:17.0.11:*:*:*:*:*:*:*"] + deprecation_date = "2026-09-30T00:00:00Z" + id = "jdk" + name = "SapMachine JDK" + purl = "pkg:generic/sap-machine-jdk@17.0.11?arch=arm64" + sha256 = "blank" + source = "https://github.com/SAP/SapMachine/archive/refs/tags/sapmachine-17.0.11.tar.gz" + source-sha256 = "d7c78dd8dafbf5d4c514eb352b7fbc298b36280a93a79c4368597c4746e1a4d8" + stacks = ["*"] + uri = "https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.11/sapmachine-jdk-17.0.11_linux-aarch64_bin.tar.gz" + version = "17.0.11" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://openjdk.java.net/legal/gplv2+ce.html" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jre:17.0.11:*:*:*:*:*:*:*"] + deprecation_date = "2026-09-30T00:00:00Z" + id = "jre" + name = "SapMachine JRE" + purl = "pkg:generic/sap-machine-jre@17.0.11?arch=arm64" + sha256 = "blank" + source = "https://github.com/SAP/SapMachine/archive/refs/tags/sapmachine-17.0.11.tar.gz" + source-sha256 = "d7c78dd8dafbf5d4c514eb352b7fbc298b36280a93a79c4368597c4746e1a4d8" + stacks = ["*"] + uri = "https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.11/sapmachine-jre-17.0.11_linux-aarch64_bin.tar.gz" + version = "17.0.11" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://openjdk.java.net/legal/gplv2+ce.html" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:21.0.3:*:*:*:*:*:*:*"] + deprecation_date = "2028-09-30T00:00:00Z" + id = "jdk" + name = "SapMachine JDK" + purl = "pkg:generic/sap-machine-jdk@21.0.3?arch=arm64" + sha256 = "blank" + source = "https://github.com/SAP/SapMachine/archive/refs/tags/sapmachine-21.0.3.tar.gz" + source-sha256 = "a7288e70b0da4a062a5adb4e6a5f65cfba6389357f87e41e4850656e5dd60250" + stacks = ["*"] + uri = "https://github.com/SAP/SapMachine/releases/download/sapmachine-21.0.3/sapmachine-jdk-21.0.3_linux-aarch64_bin.tar.gz" + version = "21.0.3" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://openjdk.java.net/legal/gplv2+ce.html" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jre:21.0.3:*:*:*:*:*:*:*"] + deprecation_date = "2028-09-30T00:00:00Z" + id = "jre" + name = "SapMachine JRE" + purl = "pkg:generic/sap-machine-jre@21.0.3?arch=arm64" + sha256 = "blank" + source = "https://github.com/SAP/SapMachine/archive/refs/tags/sapmachine-21.0.3.tar.gz" + source-sha256 = "a7288e70b0da4a062a5adb4e6a5f65cfba6389357f87e41e4850656e5dd60250" + stacks = ["*"] + uri = "https://github.com/SAP/SapMachine/releases/download/sapmachine-21.0.3/sapmachine-jre-21.0.3_linux-aarch64_bin.tar.gz" + version = "21.0.3" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://openjdk.java.net/legal/gplv2+ce.html" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:22.0.1:*:*:*:*:*:*:*"] + deprecation_date = "2024-09-17T00:00:00Z" + id = "jdk" + name = "SapMachine JDK" + purl = "pkg:generic/sap-machine-jdk@22.0.3?arch=arm64" + sha256 = "blank" + source = "https://github.com/SAP/SapMachine/archive/refs/tags/sapmachine-22.0.1.tar.gz" + source-sha256 = "6f4ee415547236da852b2855d48eefa8b1323acb31c8178ece1055f72bb9834d" + stacks = ["*"] + uri = "https://github.com/SAP/SapMachine/releases/download/sapmachine-22.0.1/sapmachine-jdk-22.0.1_linux-aarch64_bin.tar.gz" + version = "22.0.1" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://openjdk.java.net/legal/gplv2+ce.html" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jre:22.0.1:*:*:*:*:*:*:*"] + deprecation_date = "2024-09-17T00:00:00Z" + id = "jre" + name = "SapMachine JRE" + purl = "pkg:generic/sap-machine-jre@22.0.1?arch=arm64" + sha256 = "blank" + source = "https://github.com/SAP/SapMachine/archive/refs/tags/sapmachine-22.0.1.tar.gz" + source-sha256 = "6f4ee415547236da852b2855d48eefa8b1323acb31c8178ece1055f72bb9834d" + stacks = ["*"] + uri = "https://github.com/SAP/SapMachine/releases/download/sapmachine-22.0.1/sapmachine-jre-22.0.1_linux-aarch64_bin.tar.gz" + version = "22.0.1" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://openjdk.java.net/legal/gplv2+ce.html" + + [[stacks]] id = "*" diff --git a/scripts/build.sh b/scripts/build.sh index dc48240..ba5dfdc 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,14 +2,18 @@ set -euo pipefail GOMOD=$(head -1 go.mod | awk '{print $2}') +GOOS="linux" go build -ldflags='-s -w' -o "linux/amd64/bin/helper" "github.com/paketo-buildpacks/libjvm/cmd/helper" +GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o "linux/arm64/bin/helper" "github.com/paketo-buildpacks/libjvm/cmd/helper" GOOS="linux" go build -ldflags='-s -w' -o linux/amd64/bin/main "$GOMOD/cmd/main" GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o linux/arm64/bin/main "$GOMOD/cmd/main" if [ "${STRIP:-false}" != "false" ]; then + strip linux/amd64/bin/helper linux/arm64/bin/helper strip linux/amd64/bin/main linux/arm64/bin/main fi if [ "${COMPRESS:-none}" != "none" ]; then + $COMPRESS linux/amd64/bin/helper linux/arm64/bin/helper $COMPRESS linux/amd64/bin/main linux/arm64/bin/main fi From f4cdb44349dd040e7d3f0640f075029425d381cc Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Thu, 18 Apr 2024 14:19:04 -0400 Subject: [PATCH 2/2] Update .github/workflows/pb-update-go.yml --- .github/workflows/pb-update-go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pb-update-go.yml b/.github/workflows/pb-update-go.yml index df0ef0a..933ebe5 100644 --- a/.github/workflows/pb-update-go.yml +++ b/.github/workflows/pb-update-go.yml @@ -1,7 +1,7 @@ name: Update Go "on": schedule: - - cron: 27 2 * * 1 + - cron: 9 2 * * 1 workflow_dispatch: {} jobs: update: