Skip to content

Commit

Permalink
Add dualarch configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonydahanne committed Mar 15, 2024
1 parent 5c40278 commit 20be69a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
10 changes: 9 additions & 1 deletion buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@ api = "0.7"
type = "Apache-2.0"
uri = "https://github.com/paketo-buildpacks/ca-certificates/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"]
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"

[metatdata]
Expand Down
16 changes: 10 additions & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@

set -euo pipefail

GOOS="linux" go build -ldflags='-s -w' -o bin/main github.com/paketo-buildpacks/ca-certificates/v3/cmd/main
GOOS="linux" go build -ldflags='-s -w' -o bin/helper github.com/paketo-buildpacks/ca-certificates/v3/cmd/helper
GOOS="linux" go build -ldflags='-s -w' -o linux/amd64/bin/main github.com/paketo-buildpacks/ca-certificates/v3/cmd/main
GOOS="linux" go build -ldflags='-s -w' -o linux/amd64/bin/helper github.com/paketo-buildpacks/ca-certificates/v3/cmd/helper
GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o linux/arm64/bin/main github.com/paketo-buildpacks/ca-certificates/v3/cmd/main
GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o linux/arm64/bin/helper github.com/paketo-buildpacks/ca-certificates/v3/cmd/helper

if [ "${STRIP:-false}" != "false" ]; then
strip bin/helper bin/main
strip linux/amd64/bin/main linux/arm64/bin/main linux/amd64/bin/helper linux/arm64/bin/helper
fi

if [ "${COMPRESS:-none}" != "none" ]; then
$COMPRESS bin/helper bin/main
$COMPRESS linux/amd64/bin/main linux/arm64/bin/main linux/amd64/bin/helper linux/arm64/bin/helper
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

0 comments on commit 20be69a

Please sign in to comment.