Skip to content

Commit

Permalink
Merge pull request #287 from paketo-buildpacks/update/pipeline
Browse files Browse the repository at this point in the history
Bump pipeline from 1.37.2 to 1.37.2
  • Loading branch information
anthonydahanne authored Mar 28, 2024
2 parents 72dcf1e + b2e9f2c commit b94806f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# limitations under the License.

bin/
linux/
dependencies/
package/
scratch/

10 changes: 9 additions & 1 deletion buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@ api = "0.7"
type = "Apache-2.0"
uri = "https://github.com/paketo-buildpacks/sbt/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/main", "buildpack.toml"]
pre-package = "scripts/build.sh"
include-files = ["LICENSE", "NOTICE", "README.md", "linux/amd64/bin/build", "linux/amd64/bin/detect", "linux/amd64/bin/main", "linux/arm64/bin/build", "linux/arm64/bin/detect", "linux/arm64/bin/main", "buildpack.toml"]

[[metadata.configurations]]
build = true
Expand Down
15 changes: 9 additions & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#!/usr/bin/env bash

set -euo pipefail

GOOS="linux" go build -ldflags='-s -w' -tags osusergo -o bin/main github.com/paketo-buildpacks/sbt/v6/cmd/main
GOMOD=$(head -1 go.mod | awk '{print $2}')
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 bin/main
strip linux/amd64/bin/main linux/arm64/bin/main
fi

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

0 comments on commit b94806f

Please sign in to comment.