Skip to content

Commit

Permalink
Updating with examples of env behavior.
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
  • Loading branch information
jabrown85 committed Jun 3, 2020
1 parent 9dfb312 commit 564e539
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions text/0000-process-specific-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,21 @@ Each env or profile layer dir can have subdirs like `<layer>/env.launch/web/` an
# How it Works
[how-it-works]: #how-it-works

Lifecycle would use the identifier of the intended launch process to bring in additional `env` and `profile.d` files. The launcher would process these process specific values _after_ less specific values to allow [Environment Variable Modification Rules](https://github.com/buildpacks/spec/blob/master/buildpack.md#environment-variable-modification-rules) to apply in the context of a single buildpack.
Lifecycle would use the identifier of the intended launch process to bring in additional `env` and `profile.d` files. The launcher would sort these process specific values _after_ less specific values to allow [Environment Variable Modification Rules](https://github.com/buildpacks/spec/blob/master/buildpack.md#environment-variable-modification-rules) to apply as expected.

The environment modification rules should be updated to reflect that sort order for `.prepend`, `.append`, and `.override` to reflect that process specific values are more processed in the most overriding order. The following shows an example of processing order for a given layer.

```
<layers>/<layer>/env/NODE_OPTIONS.append
<layers>/<layer>/env.launch/NODE_OPTIONS.append
<layers>/<layer>/env.launch/web/NODE_OPTIONS.append
```

Example spec update:

- Environment variable file contents originating in the same layer MUST be sorted such that file contents in <layers>/<layer>/env.launch/<process>/ precede file contents in <layers>/<layer>/env.launch/, which must precede <layers>/<layer>/env/.
- Environment variable file contents originating in the same layer MUST be sorted such that file contents in <layers>/<layer>/env/ precede file contents in <layers>/<layer>/env.build/ or <layers>/<layer>/env.launch/ which must preced file contents in <layers>/<layer>/env.launch/<process>/.


# Drawbacks
[drawbacks]: #drawbacks
Expand All @@ -64,4 +78,4 @@ Lifecycle would use the identifier of the intended launch process to bring in ad
- Should lifecycle ignore invalid entries like `<layers>/<layer>/env.build/web/NODE_OPTIONS`?

# Spec. Changes (OPTIONAL)
[spec-changes]: #spec-changes
[spec-changes]: #spec-changes

0 comments on commit 564e539

Please sign in to comment.