From 6746e438398119be6a61d0face302cae04dce092 Mon Sep 17 00:00:00 2001 From: Natalie Arellano Date: Fri, 22 Sep 2023 11:59:13 -0400 Subject: [PATCH 1/2] Move package.toml to be under buildpacks/ Having everything in one directory is more convenient and more discoverable Signed-off-by: Natalie Arellano --- Makefile | 8 ++++---- .../hello-universe-windows/package.toml | 6 +++--- {packages => buildpacks}/hello-universe/package.toml | 6 +++--- buildpacks/hello-world-windows/package.toml | 5 +++++ buildpacks/hello-world/package.toml | 2 ++ packages/README.md | 8 -------- packages/hello-universe-windows/README.md | 9 --------- packages/hello-universe/README.md | 9 --------- packages/hello-world-windows/package.toml | 5 ----- packages/hello-world/package.toml | 2 -- 10 files changed, 17 insertions(+), 43 deletions(-) rename {packages => buildpacks}/hello-universe-windows/package.toml (58%) rename {packages => buildpacks}/hello-universe/package.toml (58%) create mode 100644 buildpacks/hello-world-windows/package.toml create mode 100644 buildpacks/hello-world/package.toml delete mode 100644 packages/README.md delete mode 100644 packages/hello-universe-windows/README.md delete mode 100644 packages/hello-universe/README.md delete mode 100644 packages/hello-world-windows/package.toml delete mode 100644 packages/hello-world/package.toml diff --git a/Makefile b/Makefile index 6cff0a0d..5adf0e89 100644 --- a/Makefile +++ b/Makefile @@ -79,10 +79,10 @@ build-buildpacks-jammy: build-sample-root build-linux-packages: build-sample-root @echo "> Creating 'hello-world' buildpack package" - $(PACK_CMD) buildpack package cnbs/sample-package:hello-world --config $(SAMPLES_ROOT)/packages/hello-world/package.toml $(PULL_POLICY_NEVER) + $(PACK_CMD) buildpack package cnbs/sample-package:hello-world --config $(SAMPLES_ROOT)/buildpacks/hello-world/package.toml $(PULL_POLICY_NEVER) @echo "> Creating 'hello-universe' buildpack package" - $(PACK_CMD) buildpack package cnbs/sample-package:hello-universe --config $(SAMPLES_ROOT)/packages/hello-universe/package.toml $(PULL_POLICY_NEVER) + $(PACK_CMD) buildpack package cnbs/sample-package:hello-universe --config $(SAMPLES_ROOT)/buildpacks/hello-universe/package.toml $(PULL_POLICY_NEVER) deploy-linux: deploy-linux-bases deploy-linux-packages deploy-linux-builders @@ -190,10 +190,10 @@ build-buildpacks-dotnet-framework-2022: build-sample-root build-windows-packages: build-sample-root @echo "> Creating 'hello-world-windows' buildpack package" - $(PACK_CMD) buildpack package cnbs/sample-package:hello-world-windows --config $(SAMPLES_ROOT)/packages/hello-world-windows/package.toml $(PULL_POLICY_NEVER) + $(PACK_CMD) buildpack package cnbs/sample-package:hello-world-windows --config $(SAMPLES_ROOT)/buildpacks/hello-world-windows/package.toml $(PULL_POLICY_NEVER) @echo "> Creating 'hello-universe-windows' buildpack package" - $(PACK_CMD) buildpack package cnbs/sample-package:hello-universe-windows --config $(SAMPLES_ROOT)/packages/hello-universe-windows/package.toml $(PULL_POLICY_NEVER) + $(PACK_CMD) buildpack package cnbs/sample-package:hello-universe-windows --config $(SAMPLES_ROOT)/buildpacks/hello-universe-windows/package.toml $(PULL_POLICY_NEVER) deploy-windows-packages: @echo "> Deploying windows packages..." diff --git a/packages/hello-universe-windows/package.toml b/buildpacks/hello-universe-windows/package.toml similarity index 58% rename from packages/hello-universe-windows/package.toml rename to buildpacks/hello-universe-windows/package.toml index 82046508..dc1ecac0 100644 --- a/packages/hello-universe-windows/package.toml +++ b/buildpacks/hello-universe-windows/package.toml @@ -1,11 +1,11 @@ [buildpack] -uri = "../../buildpacks/hello-universe-windows" +uri = "." [[dependencies]] -uri = "../../buildpacks/hello-moon-windows" +uri = "../hello-moon-windows" [[dependencies]] -uri = "../../buildpacks/hello-world-windows" +uri = "../hello-world-windows" # Alternatively, to use an image while packaging, you can use: # uri = "docker://cnbs/sample-package:hello-world-windows" diff --git a/packages/hello-universe/package.toml b/buildpacks/hello-universe/package.toml similarity index 58% rename from packages/hello-universe/package.toml rename to buildpacks/hello-universe/package.toml index bc7592e6..5aaeb0d4 100644 --- a/packages/hello-universe/package.toml +++ b/buildpacks/hello-universe/package.toml @@ -1,10 +1,10 @@ [buildpack] -uri = "../../buildpacks/hello-universe/" +uri = "." [[dependencies]] -uri = "../../buildpacks/hello-moon" +uri = "../hello-moon" [[dependencies]] -uri = "../../buildpacks/hello-world" +uri = "../hello-world" # Alternatively, to use an image while packaging, you can use: # uri = "docker://cnbs/sample-package:hello-world" diff --git a/buildpacks/hello-world-windows/package.toml b/buildpacks/hello-world-windows/package.toml new file mode 100644 index 00000000..66c7fe53 --- /dev/null +++ b/buildpacks/hello-world-windows/package.toml @@ -0,0 +1,5 @@ +[buildpack] +uri = "." + +[platform] +os = "windows" diff --git a/buildpacks/hello-world/package.toml b/buildpacks/hello-world/package.toml new file mode 100644 index 00000000..54b0d2e4 --- /dev/null +++ b/buildpacks/hello-world/package.toml @@ -0,0 +1,2 @@ +[buildpack] +uri = "." diff --git a/packages/README.md b/packages/README.md deleted file mode 100644 index 3a08716e..00000000 --- a/packages/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Sample Buildpackages - -Buildpackages are simply configuration for packaging buildpacks and their dependencies. Once created, buildpackages live in container registries (such as Dockerhub) and can be used to [create builder images](../builders/jammy/builder.toml#L17-L18) or [referenced in other buildpackages](hello-universe/package.toml#L8) to compose larger units of functionality. - -### Additional Resources - -* [An App's Journey (Buildpacks overview)](https://buildpacks.io/docs/app-journey/) -* [Create a buildpack tutorial](https://buildpacks.io/docs/create-buildpack/) diff --git a/packages/hello-universe-windows/README.md b/packages/hello-universe-windows/README.md deleted file mode 100644 index fe979a24..00000000 --- a/packages/hello-universe-windows/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Sample: Hello Universe Buildpack (Packaged) - -A no-op buildpack whose intent is to show how meta-buildpacks can be packaged. - -### Usage - -```bash -pack buildpack package cnbs/sample-package:hello-universe-windows --config package.toml -``` diff --git a/packages/hello-universe/README.md b/packages/hello-universe/README.md deleted file mode 100644 index d6237878..00000000 --- a/packages/hello-universe/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Sample: Hello Universe Buildpack (Packaged) - -A no-op buildpack whose intent is to show how meta-buildpacks can be packaged. - -### Usage - -```bash -pack buildpack package cnbs/sample-package:hello-universe --config package.toml -``` diff --git a/packages/hello-world-windows/package.toml b/packages/hello-world-windows/package.toml deleted file mode 100644 index 0a672391..00000000 --- a/packages/hello-world-windows/package.toml +++ /dev/null @@ -1,5 +0,0 @@ -[buildpack] -uri = "../../buildpacks/hello-world-windows" - -[platform] -os = "windows" diff --git a/packages/hello-world/package.toml b/packages/hello-world/package.toml deleted file mode 100644 index 92fd5a3b..00000000 --- a/packages/hello-world/package.toml +++ /dev/null @@ -1,2 +0,0 @@ -[buildpack] -uri = "../../buildpacks/hello-world/" From 02b47f4650c63ece1edd2f97afa515eb5562e249 Mon Sep 17 00:00:00 2001 From: Natalie Arellano Date: Fri, 22 Sep 2023 12:18:49 -0400 Subject: [PATCH 2/2] Move package.toml to be under buildpacks/ Having everything in one directory is more convenient and more discoverable Signed-off-by: Natalie Arellano --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5adf0e89..87cb9982 100644 --- a/Makefile +++ b/Makefile @@ -79,10 +79,10 @@ build-buildpacks-jammy: build-sample-root build-linux-packages: build-sample-root @echo "> Creating 'hello-world' buildpack package" - $(PACK_CMD) buildpack package cnbs/sample-package:hello-world --config $(SAMPLES_ROOT)/buildpacks/hello-world/package.toml $(PULL_POLICY_NEVER) + $(PACK_CMD) buildpack package cnbs/sample-package:hello-world --config $(SAMPLES_ROOT)/$(PACKAGES_DIR)/hello-world/package.toml $(PULL_POLICY_NEVER) @echo "> Creating 'hello-universe' buildpack package" - $(PACK_CMD) buildpack package cnbs/sample-package:hello-universe --config $(SAMPLES_ROOT)/buildpacks/hello-universe/package.toml $(PULL_POLICY_NEVER) + $(PACK_CMD) buildpack package cnbs/sample-package:hello-universe --config $(SAMPLES_ROOT)/$(PACKAGES_DIR)/hello-universe/package.toml $(PULL_POLICY_NEVER) deploy-linux: deploy-linux-bases deploy-linux-packages deploy-linux-builders @@ -190,10 +190,10 @@ build-buildpacks-dotnet-framework-2022: build-sample-root build-windows-packages: build-sample-root @echo "> Creating 'hello-world-windows' buildpack package" - $(PACK_CMD) buildpack package cnbs/sample-package:hello-world-windows --config $(SAMPLES_ROOT)/buildpacks/hello-world-windows/package.toml $(PULL_POLICY_NEVER) + $(PACK_CMD) buildpack package cnbs/sample-package:hello-world-windows --config $(SAMPLES_ROOT)/$(PACKAGES_DIR)/hello-world-windows/package.toml $(PULL_POLICY_NEVER) @echo "> Creating 'hello-universe-windows' buildpack package" - $(PACK_CMD) buildpack package cnbs/sample-package:hello-universe-windows --config $(SAMPLES_ROOT)/buildpacks/hello-universe-windows/package.toml $(PULL_POLICY_NEVER) + $(PACK_CMD) buildpack package cnbs/sample-package:hello-universe-windows --config $(SAMPLES_ROOT)/$(PACKAGES_DIR)/hello-universe-windows/package.toml $(PULL_POLICY_NEVER) deploy-windows-packages: @echo "> Deploying windows packages..." @@ -262,6 +262,7 @@ clean-windows: # workaround by pivoting samples-root to tmp path with tgz-buildpacks of the same name ifeq ($(OS),Windows_NT) SAMPLES_ROOT:=$(shell mkdir -p .tmp && mktemp --directory -p . .tmp/samples-XXX) +PACKAGES_DIR:=packages build-sample-root: @mkdir -p $(SAMPLES_ROOT)/buildpacks/ @@ -269,10 +270,12 @@ build-sample-root: tar -czf $(SAMPLES_ROOT)/buildpacks/$$(basename $$bp_dir) -C $$bp_dir . ; \ done - @cp -r builders packages $(SAMPLES_ROOT)/ + @cp -r builders $(SAMPLES_ROOT)/ + @cp -r buildpacks $(SAMPLES_ROOT)/$(PACKAGES_DIR) else # No-op for posix pack SAMPLES_ROOT:=. +PACKAGES_DIR:=buildpacks build-sample-root: endif