diff --git a/.github/pipeline-descriptor.yml b/.github/pipeline-descriptor.yml index 3a427a8..197e1cb 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/java-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 7901d74..2e00ed7 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/google-stackdriver@${{ steps.package.outputs.digest }} id: paketo-buildpacks/google-stackdriver 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-google-stackdriver-profiler-java.yml b/.github/workflows/pb-update-google-stackdriver-profiler-java.yml index 4f63ce1..60afe8e 100644 --- a/.github/workflows/pb-update-google-stackdriver-profiler-java.yml +++ b/.github/workflows/pb-update-google-stackdriver-profiler-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/.github/workflows/pb-update-google-stackdriver-profiler-nodejs.yml b/.github/workflows/pb-update-google-stackdriver-profiler-nodejs.yml index 098bc03..2461535 100644 --- a/.github/workflows/pb-update-google-stackdriver-profiler-nodejs.yml +++ b/.github/workflows/pb-update-google-stackdriver-profiler-nodejs.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 592c46e..2f65ee4 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ # limitations under the License. bin/ +linux/ dependencies/ package/ scratch/ + diff --git a/README.md b/README.md index 0eaef3f..dd6fc2f 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ The buildpack will do the following for NodeJS applications: * If main module does not already require `@google-cloud/profiler` module, prepends the main module with `require('@google-cloud/profiler').start();` * Sets `$GOOGLE_APPLICATION_CREDENTIALS` to the path of the `ApplicationCredentials` secret +## 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. + ## Configuration | Environment Variable | Description | diff --git a/buildpack.toml b/buildpack.toml index 6ee8674..c7cf383 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -28,7 +28,7 @@ api = "0.7" uri = "https://github.com/paketo-buildpacks/google-stackdriver/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.configurations]] @@ -79,3 +79,11 @@ api = "0.7" [[stacks]] id = "*" + +[[targets]] + arch = "amd64" + os = "linux" + +[[targets]] + arch = "arm64" + os = "linux" diff --git a/scripts/build.sh b/scripts/build.sh index fac2e7a..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/google-stackdriver/v5/cmd/helper -GOOS="linux" go build -ldflags='-s -w' -o bin/main github.com/paketo-buildpacks/google-stackdriver/v5/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:-none}" != "none" ]; then - $COMPRESS bin/helper bin/main + $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