-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds sample buildpackages for Windows
Signed-off-by: Micah Young <[email protected]>
- Loading branch information
Micah Young
committed
Oct 12, 2020
1 parent
cb8ff3e
commit c2e07c4
Showing
14 changed files
with
153 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Sample: Hello World Buildpack | ||
|
||
A no-op buildpack whose intent is to show how buildpack dependencies work. This buildpack depends on [hello-world](../hello-world). | ||
|
||
### Usage | ||
|
||
```bash | ||
pack build sample-hello-moon-app --builder cnbs/sample-builder:alpine --buildpack ../hello-world/ --buildpack . | ||
``` | ||
|
||
OR | ||
|
||
```bash | ||
pack build sample-hello-moon-app --builder cnbs/sample-builder:bionic --buildpack ../hello-world/ --buildpack . | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@echo off | ||
|
||
echo --- Hello Moon buildpack | ||
|
||
set env_dir=%2\env | ||
set layers_dir=%1 | ||
set plan_path=%3 | ||
|
||
echo env_dir: %env_dir% | ||
echo env_vars: | ||
for /f "tokens=*" %%f in ('dir /s /q /b %env_dir%') do ( | ||
for /f %%v in ('type %%f') do ( | ||
set %%~nf=%%v | ||
) | ||
) | ||
for /f "tokens=*" %%o in ('set') do ( | ||
echo %%o | ||
) | ||
|
||
echo layers_dir: %layers_dir% | ||
echo plan_path: %plan_path% | ||
echo plan contents: | ||
for /f "tokens=*" %%o in ('type %plan_path%') do ( | ||
echo %%o | ||
) | ||
|
||
echo --- Done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@echo off | ||
|
||
:: 1. GET ARGS | ||
set plan_path=%2 | ||
|
||
:: 2. DECLARE DEPENDENCIES (OPTIONAL) | ||
( | ||
echo [[requires]] | ||
echo name = "some-world" | ||
echo version = "0.1" | ||
|
||
echo [requires.metadata] | ||
echo world = "Earth-616" | ||
) >> %plan_path% | ||
|
||
exit /b 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Buildpack API version | ||
api = "0.2" | ||
|
||
# Buildpack ID and metadata | ||
[buildpack] | ||
id = "samples/hello-moon-windows" | ||
version = "0.0.1" | ||
name = "Hello Moon Buildpack" | ||
homepage = "https://github.com/buildpacks/samples/tree/main/buildpacks/hello-moon-windows" | ||
|
||
# Stacks that the buildpack will work with | ||
[[stacks]] | ||
id = "io.buildpacks.samples.stacks.nanoserver-1809" | ||
|
||
[[stacks]] | ||
id = "io.buildpacks.samples.stacks.dotnet-framework-1809" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
# Sample: Hello World Buildpack | ||
|
||
A no-op buildpack whose intent is to show how buildpack dependencies work. This buildpack depends on [hello-world](../hello-world). | ||
A no-op buildpack whose intent is to show how buildpack dependencies work. This buildpack depends on [hello-world-windows](../hello-world-windows). | ||
|
||
### Usage | ||
|
||
```bash | ||
pack build sample-hello-moon-app --builder cnbs/sample-builder:alpine --buildpack ../hello-world/ --buildpack . | ||
pack build sample-hello-moon-windows-app --builder cnbs/sample-builder:nanoserver-1809 --buildpack ../hello-world-windows/ --buildpack . | ||
``` | ||
|
||
OR | ||
|
||
```bash | ||
pack build sample-hello-moon-app --builder cnbs/sample-builder:bionic --buildpack ../hello-world/ --buildpack . | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Sample: Hello Universe Buildpack | ||
|
||
A no-op meta-buildpack whose intent is to show how meta-buildpacks are constructed. | ||
|
||
### Usage | ||
|
||
```bash | ||
pack build sample-hello-universe-windows-app \ | ||
--builder cnbs/sample-builder:nanoserver-1809 \ | ||
--buildpack . \ | ||
--buildpack ../hello-world-windows/ \ | ||
--buildpack ../hello-moon-windows/ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Buildpack API version | ||
api = "0.2" | ||
|
||
# Buildpack ID and metadata | ||
[buildpack] | ||
id = "samples/hello-universe-windows" | ||
version = "0.0.1" | ||
name = "Hello Universe Buildpack" | ||
homepage = "https://github.com/buildpacks/samples/tree/main/buildpacks/hello-universe-windows" | ||
|
||
# Order used for detection | ||
[[order]] | ||
[[order.group]] | ||
id = "samples/hello-world-windows" | ||
version = "0.0.1" | ||
|
||
[[order.group]] | ||
id = "samples/hello-moon-windows" | ||
version = "0.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Sample: Hello Universe Buildpack (Packaged) | ||
|
||
A no-op buildpack whose intent is to show how meta-buildpacks can be packaged. | ||
|
||
### Usage | ||
|
||
```bash | ||
pack create-package cnbs/sample-package:hello-universe-windows --config package.toml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[buildpack] | ||
uri = "../../buildpacks/hello-universe-windows" | ||
|
||
[[dependencies]] | ||
uri = "../../buildpacks/hello-moon-windows" | ||
|
||
[[dependencies]] | ||
uri = "../../buildpacks/hello-world-windows" | ||
# Alternatively, to use an image while packaging, you can use: | ||
# image = "cnbs/sample-package:hello-world-windows" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[buildpack] | ||
uri = "../../buildpacks/hello-world-windows" |