diff --git a/.github/pipeline-descriptor.yml b/.github/pipeline-descriptor.yml index ae97eb4..98908e3 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": "$GOMOD/cmd/helper" + codeowners: - path: "*" owner: "@paketo-buildpacks/app-monitoring-maintainers" diff --git a/.github/pipeline-version b/.github/pipeline-version index 5edffce..32b7211 100644 --- a/.github/pipeline-version +++ b/.github/pipeline-version @@ -1 +1 @@ -1.39.0 +1.40.0 diff --git a/.github/workflows/pb-create-package.yml b/.github/workflows/pb-create-package.yml index bfbfb0b..e7da42b 100644 --- a/.github/workflows/pb-create-package.yml +++ b/.github/workflows/pb-create-package.yml @@ -33,24 +33,13 @@ jobs: set -euo pipefail go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/create-package@latest - - uses: buildpacks/github-actions/setup-tools@v5.6.0 + - uses: buildpacks/github-actions/setup-tools@v5.7.2 with: crane-version: 0.19.1 yj-version: 5.1.0 - - name: Install pack - run: | - #!/usr/bin/env bash - # this is coming from a copy of https://github.com/buildpacks/pack/actions/runs/8118576298 stored on box - # TODO to revisit when the official one is out - set -euo pipefail - - echo "Installing pack experimental" - - mkdir -p "${HOME}"/bin - echo "${HOME}/bin" >> "${GITHUB_PATH}" - - curl -L "https://ent.box.com/shared/static/j4d1bfe9uk1sb0i7zjvci0md9xmy41u4" -o ${HOME}/bin/pack - chmod +x "${HOME}"/bin/pack + - uses: buildpacks/github-actions/setup-pack@v5.7.2 + with: + pack-version: 0.34.2 - name: Enable pack Experimental if: ${{ false }} run: | @@ -219,7 +208,7 @@ jobs: DIGEST: ${{ steps.package.outputs.digest }} GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} - if: ${{ true }} - uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:5.6.0 + uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:5.7.2 with: address: docker.io/paketobuildpacks/aternity@${{ steps.package.outputs.digest }} id: paketo-buildpacks/aternity diff --git a/.github/workflows/pb-tests.yml b/.github/workflows/pb-tests.yml index 3f2fddb..e47ad65 100644 --- a/.github/workflows/pb-tests.yml +++ b/.github/workflows/pb-tests.yml @@ -25,20 +25,9 @@ jobs: set -euo pipefail go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/create-package@latest - - name: Install pack - run: | - #!/usr/bin/env bash - # this is coming from a copy of https://github.com/buildpacks/pack/actions/runs/8118576298 stored on box - # TODO to revisit when the official one is out - set -euo pipefail - - echo "Installing pack experimental" - - mkdir -p "${HOME}"/bin - echo "${HOME}/bin" >> "${GITHUB_PATH}" - - curl -L "https://ent.box.com/shared/static/j4d1bfe9uk1sb0i7zjvci0md9xmy41u4" -o ${HOME}/bin/pack - chmod +x "${HOME}"/bin/pack + - uses: buildpacks/github-actions/setup-pack@v5.7.2 + with: + pack-version: 0.34.2 - name: Enable pack Experimental if: ${{ false }} run: | diff --git a/.github/workflows/pb-update-appinternals-java.yml b/.github/workflows/pb-update-appinternals-java.yml index 3182d10..dd31dcc 100644 --- a/.github/workflows/pb-update-appinternals-java.yml +++ b/.github/workflows/pb-update-appinternals-java.yml @@ -19,7 +19,7 @@ jobs: 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.6.0 + - uses: buildpacks/github-actions/setup-tools@v5.7.2 with: crane-version: 0.19.1 yj-version: 5.1.0 diff --git a/.gitignore b/.gitignore index b90fc75..2f65ee4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Copyright 2018-2022 the original author or authors. +# Copyright 2018-2020 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +13,8 @@ # limitations under the License. bin/ +linux/ dependencies/ package/ scratch/ + diff --git a/README.md b/README.md index e7454d7..5f2feaa 100644 --- a/README.md +++ b/README.md @@ -13,13 +13,17 @@ The buildpack will do the following for Java applications: * Contributes a Java agent to a layer and configures `$JAVA_TOOL_OPTIONS` to use it * Transforms the contents of the binding secret to environment variables with the pattern `=` +## Notes + +While this buildpack is packaged to support ARM64 there are no upstream bindings for Aternity on ARM64. If you try to use this buildpack on ARM64 it will fail attempting to download ARM64 binaries that do not exist. Please contact the vendor if you'd like to see ARM64 support. The buildpack is positioned to support it as soon as it is available upstream. + ## Bindings The buildpack optionally accepts the following bindings: ### Type: `dependency-mapping` -|Key | Value | Description -|----------------------|---------|------------ -|`` | `` | If needed, the buildpack will fetch the dependency with digest `` from `` +| Key | Value | Description | +| --------------------- | ------- | ------------------------------------------------------------------------------------------------- | +| `` | `` | If needed, the buildpack will fetch the dependency with digest `` from `` | ## License diff --git a/buildpack.toml b/buildpack.toml index 6195df4..7dbf6a3 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -1,4 +1,4 @@ -# Copyright 2018-2022 the original author or authors. +# Copyright 2018-2024 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ api = "0.7" uri = "https://github.com/paketo-buildpacks/aternity/blob/main/LICENSE" [metadata] - include-files = ["LICENSE", "NOTICE", "README.md", "bin/build", "bin/detect", "bin/helper", "bin/main", "buildpack.toml"] + include-files = ["LICENSE", "NOTICE", "README.md", "linux/amd64/bin/build", "linux/amd64/bin/detect", "linux/amd64/bin/main", "linux/amd64/bin/helper", "linux/arm64/bin/build", "linux/arm64/bin/detect", "linux/arm64/bin/main", "linux/arm64/bin/helper", "buildpack.toml"] pre-package = "scripts/build.sh" [[metadata.dependencies]] @@ -37,7 +37,7 @@ api = "0.7" name = "Aternity AppInternals Java Agent" purl = "pkg:generic/aternity-appinternals-java-agent@11.8.5?arch=amd64" sha256 = "8242054c1828196a5605ac8225f2fdf3a947931c3e4db6e2e4b26df70bbaffe0" - stacks = ["io.buildpacks.stacks.bionic", "io.paketo.stacks.tiny", "*"] + stacks = ["*"] uri = "https://pcf-instrumentation-download.steelcentral.net/riverbed-appinternals-agent-11.8.5_BL527.zip" version = "11.8.5" @@ -45,10 +45,12 @@ api = "0.7" uri = "https://www.riverbed.com/document/legal/riverbed-end-user-license-agreement.pdf" [[stacks]] - id = "io.buildpacks.stacks.bionic" + id = "*" -[[stacks]] - id = "io.paketo.stacks.tiny" +[[targets]] + arch = "amd64" + os = "linux" -[[stacks]] - id = "*" +[[targets]] + arch = "arm64" + os = "linux" diff --git a/scripts/build.sh b/scripts/build.sh index d2a746c..9b05e98 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,17 +1,23 @@ #!/usr/bin/env bash - set -euo pipefail -GOOS="linux" go build -ldflags='-s -w' -o bin/helper github.com/paketo-buildpacks/aternity/v4/cmd/helper -GOOS="linux" go build -ldflags='-s -w' -o bin/main github.com/paketo-buildpacks/aternity/v4/cmd/main +GOMOD=$(head -1 go.mod | awk '{print $2}') +GOOS="linux" GOARCH="amd64" go build -ldflags='-s -w' -o "linux/amd64/bin/helper" "$GOMOD/cmd/helper" +GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o "linux/arm64/bin/helper" "$GOMOD/cmd/helper" +GOOS="linux" GOARCH="amd64" 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 bin/helper bin/main + strip linux/amd64/bin/helper linux/arm64/bin/helper + strip linux/amd64/bin/main linux/arm64/bin/main fi -if [ "${COMPRESS:-false}" != "false" ]; then - upx -q -9 bin/helper bin/main +if [ "${COMPRESS:-none}" != "none" ]; then + $COMPRESS linux/amd64/bin/helper linux/arm64/bin/helper + $COMPRESS linux/amd64/bin/main linux/arm64/bin/main fi -ln -fs main bin/build -ln -fs main bin/detect +ln -fs main linux/amd64/bin/build +ln -fs main linux/arm64/bin/build +ln -fs main linux/amd64/bin/detect +ln -fs main linux/arm64/bin/detect \ No newline at end of file