Skip to content

Commit 582256c

Browse files
authored
Merge pull request #419 from buildpacks/copilot/fix-5b111c9e-e1c3-498a-9786-bfe6dbc98fa4
[WIP] [RFC #101] Add System Buildpack to Platform API
2 parents 9b0de62 + 52a4c8f commit 582256c

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

platform.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Examples of a platform might include:
8888
- [`project-metadata.toml` (TOML)](#project-metadatatoml-toml)
8989
- [`report.toml` (TOML)](#reporttoml-toml)
9090
- [`run.toml` (TOML)](#runtoml-toml)
91+
- [`system.toml` (TOML)](#systemtoml-toml)
9192
- [Labels](#labels)
9293
- [`io.buildpacks.build.metadata` (JSON)](#iobuildpacksbuildmetadata-json)
9394
- [`io.buildpacks.lifecycle.metadata` (JSON)](#iobuildpackslifecyclemetadata-json)
@@ -389,7 +390,8 @@ Usage:
389390
[-order <order>] \
390391
[-plan <plan>] \
391392
[-platform <platform>] \
392-
[-run <run> ]
393+
[-run <run> ] \
394+
[-system <system>]
393395
```
394396

395397
##### Inputs
@@ -409,6 +411,7 @@ Usage:
409411
| `<plan>` | `CNB_PLAN_PATH` | `<layers>/plan.toml` | Path to output resolved build plan |
410412
| `<platform>` | `CNB_PLATFORM_DIR` | `/platform` | Path to platform directory |
411413
| `<run>`^ | `CNB_RUN_PATH` | `/cnb/run.toml` | Path to run file (see [`run.toml`](#runtoml-toml)) |
414+
| `<system>` | `CNB_SYSTEM_PATH` | `/cnb/system.toml` | Path to system buildpacks file (see [`system.toml`](#systemtoml-toml)) |
412415

413416
> ^Only needed when using image extensions
414417
@@ -438,6 +441,12 @@ Usage:
438441
| `91` | Extension generate error |
439442
| `92-99` | Generation-specific lifecycle errors |
440443

444+
When `<system>` is provided (optional), the lifecycle:
445+
- SHALL merge the `system.pre.buildpacks` group with each group from `<order>` such that the `pre` buildpacks are placed at the beginning of each order group before running detection.
446+
- System buildpacks in `pre` SHALL NOT be merged if the group already contains a buildpack with the same ID.
447+
- SHALL merge the `system.post.buildpacks` group with each group from `<order>` such that the `post` buildpacks are placed at the end of each order group before running detection.
448+
- System buildpacks in `post` SHALL NOT be merged if the group already contains a buildpack with the same ID.
449+
441450
The lifecycle:
442451
- SHALL detect a single group from `<order>` and write it to `<group>` using the [detection process](buildpack.md#phase-1-detection) outlined in the Buildpack Interface Specification
443452
- SHALL write the resolved build plan from the detected group to `<plan>`
@@ -1433,6 +1442,27 @@ Where:
14331442
- SHOULD reference an image with ID identical to that of `image.image`
14341443
- `image.image` and `image.mirrors.[]` SHOULD each refer to a unique registry
14351444

1445+
#### `system.toml` (TOML)
1446+
1447+
```toml
1448+
[[system.pre.buildpacks]]
1449+
id = "<buildpack ID>"
1450+
version = "<buildpack version>"
1451+
optional = false
1452+
1453+
[[system.post.buildpacks]]
1454+
id = "<buildpack ID>"
1455+
version = "<buildpack version>"
1456+
optional = false
1457+
```
1458+
1459+
Where:
1460+
1461+
- `system.pre.buildpacks` MAY contain a list of buildpacks to insert at the beginning of every order group before detection.
1462+
- `system.post.buildpacks` MAY contain a list of buildpacks to insert at the end of every order group before detection.
1463+
- Both `id` and `version` MUST be present for each buildpack object in `system.pre.buildpacks` and `system.post.buildpacks`.
1464+
- The value of `optional` MUST default to `false` if not specified.
1465+
14361466
### Labels
14371467

14381468
#### `io.buildpacks.build.metadata` (JSON)

0 commit comments

Comments
 (0)