Skip to content

Commit

Permalink
Submit a new rfc for build environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kappratiksha committed Sep 11, 2023
1 parent 75af1f3 commit 4c5836a
Showing 1 changed file with 96 additions and 0 deletions.
96 changes: 96 additions & 0 deletions text/0000-cnb-env-var.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Meta
[meta]: #meta
- Name: Support for env vars in creator
- Start Date: 2023-09-07
- Author(s): [kappratiksha](https://github.com/kappratiksha)
- Status: Draft
- RFC Pull Request: (leave blank)
- CNB Pull Request: (leave blank)
- CNB Issue: (leave blank)
- Supersedes: N/A

# Summary
[summary]: #summary

Add a flag for passing the build time env variables to buildpacks when invoking creator

# Definitions
[definitions]: #definitions

N/A

# Motivation
[motivation]: #motivation

When invoking the creator process, there is no way to pass build time environment variables to the buildpacks other than creating the files under /platform/env folder. This adds an extra step for the authors when implementing their buildpack. Adding a new flag to the creator process will simplify the process of setting the environment variables.

We already have something similar for the [pack cli tool](https://buildpacks.io/docs/tools/pack/cli/pack_build/) and it proves to be very convenient. Example:

```
pack build test_img --env VAR1=VALUE1
```

# What it is
[what-it-is]: #what-it-is

A flag that can be used by buildpack user to pass down the environment variables while invoking creator.

/cnb/lifecycle/creator -env stringArray

A sample use case would look like:
```
/cnb/lifecycle/creator -env LANGUAGE=java -env VERSION=1.1
```

# How it Works
[how-it-works]: #how-it-works


Before calling the `bin\detect`, create environment variables passed down by the flag `--env` under /platform/env folder

# Migration
[migration]: #migration


# Drawbacks
[drawbacks]: #drawbacks


# Alternatives
[alternatives]: #alternatives


# Prior Art
[prior-art]: #prior-art


# Unresolved Questions
[unresolved-questions]: #unresolved-questions

- What parts of the design do you expect to be resolved before this gets merged?
This will improve the effeciency of using the build environment variables. Instead of users having to set the environment variables manually by creating the folders, they can now use the new flag.

# Spec. Changes (OPTIONAL)
[spec-changes]: #spec-changes
This change will involve some spec changes for the new flag.

# History
[history]: #history

<!--
## Amended
### Meta
[meta-1]: #meta-1
- Name: (fill in the amendment name: Variable Rename)
- Start Date: (fill in today's date: YYYY-MM-DD)
- Author(s): (Github usernames)
- Amendment Pull Request: (leave blank)
### Summary
A brief description of the changes.
### Motivation
Why was this amendment necessary?
--->

0 comments on commit 4c5836a

Please sign in to comment.