From 9d22ebbc2ee5127a1cb93191dde7595d2130983b Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Wed, 2 Jun 2021 10:48:05 -0400 Subject: [PATCH] Bump the lifecycle to 0.6, add description, keywords and license metadata and make running 'upx' optional, default off in build script, and sets web as the default process type --- buildpack.toml | 8 +++++++- distzip/build.go | 2 +- distzip/build_test.go | 2 +- scripts/build.sh | 9 +++++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/buildpack.toml b/buildpack.toml index 4485d4c..79c22d9 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -12,13 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -api = "0.5" +api = "0.6" [buildpack] id = "paketo-buildpacks/dist-zip" name = "Paketo DistZip Buildpack" version = "{{.version}}" homepage = "https://github.com/paketo-buildpacks/dist-zip" +description = "A Cloud Native Buildpack that contributes a Process Type for DistZip-style applications" +keywords = ["java", "dist-zip"] + +[[buildpack.licenses]] +type = "Apache-2.0" +uri = "https://github.com/paketo-buildpacks/dist-zip/blob/main/LICENSE" [[stacks]] id = "io.buildpacks.stacks.bionic" diff --git a/distzip/build.go b/distzip/build.go index 3adfa51..3b47677 100644 --- a/distzip/build.go +++ b/distzip/build.go @@ -62,7 +62,7 @@ func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error) { result.Processes = append(result.Processes, libcnb.Process{Type: "dist-zip", Command: s}, libcnb.Process{Type: "task", Command: s}, - libcnb.Process{Type: "web", Command: s}, + libcnb.Process{Type: "web", Command: s, Default: true}, ) return result, nil diff --git a/distzip/build_test.go b/distzip/build_test.go index 01072e9..c7e1fe1 100644 --- a/distzip/build_test.go +++ b/distzip/build_test.go @@ -74,7 +74,7 @@ func testBuild(t *testing.T, context spec.G, it spec.S) { Expect(result.Processes).To(ContainElements( libcnb.Process{Type: "dist-zip", Command: filepath.Join(ctx.Application.Path, "app", "bin", "test-script")}, libcnb.Process{Type: "task", Command: filepath.Join(ctx.Application.Path, "app", "bin", "test-script")}, - libcnb.Process{Type: "web", Command: filepath.Join(ctx.Application.Path, "app", "bin", "test-script")}, + libcnb.Process{Type: "web", Command: filepath.Join(ctx.Application.Path, "app", "bin", "test-script"), Default: true}, )) }) }) diff --git a/scripts/build.sh b/scripts/build.sh index 2bfc626..55df1e0 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -4,8 +4,13 @@ set -euo pipefail GOOS="linux" go build -ldflags='-s -w' -o bin/main github.com/paketo-buildpacks/dist-zip/cmd/main -strip bin/main -upx -q -9 bin/main +if [ "${STRIP:-false}" != "false" ]; then + strip bin/main +fi + +if [ "${COMPRESS:-false}" != "false" ]; then + upx -q -9 bin/main +fi ln -fs main bin/build ln -fs main bin/detect