Skip to content

Commit 4c5836a

Browse files
committed
Submit a new rfc for build environment variables
1 parent 75af1f3 commit 4c5836a

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

text/0000-cnb-env-var.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Meta
2+
[meta]: #meta
3+
- Name: Support for env vars in creator
4+
- Start Date: 2023-09-07
5+
- Author(s): [kappratiksha](https://github.com/kappratiksha)
6+
- Status: Draft
7+
- RFC Pull Request: (leave blank)
8+
- CNB Pull Request: (leave blank)
9+
- CNB Issue: (leave blank)
10+
- Supersedes: N/A
11+
12+
# Summary
13+
[summary]: #summary
14+
15+
Add a flag for passing the build time env variables to buildpacks when invoking creator
16+
17+
# Definitions
18+
[definitions]: #definitions
19+
20+
N/A
21+
22+
# Motivation
23+
[motivation]: #motivation
24+
25+
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.
26+
27+
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:
28+
29+
```
30+
pack build test_img --env VAR1=VALUE1
31+
```
32+
33+
# What it is
34+
[what-it-is]: #what-it-is
35+
36+
A flag that can be used by buildpack user to pass down the environment variables while invoking creator.
37+
38+
/cnb/lifecycle/creator -env stringArray
39+
40+
A sample use case would look like:
41+
```
42+
/cnb/lifecycle/creator -env LANGUAGE=java -env VERSION=1.1
43+
```
44+
45+
# How it Works
46+
[how-it-works]: #how-it-works
47+
48+
49+
Before calling the `bin\detect`, create environment variables passed down by the flag `--env` under /platform/env folder
50+
51+
# Migration
52+
[migration]: #migration
53+
54+
55+
# Drawbacks
56+
[drawbacks]: #drawbacks
57+
58+
59+
# Alternatives
60+
[alternatives]: #alternatives
61+
62+
63+
# Prior Art
64+
[prior-art]: #prior-art
65+
66+
67+
# Unresolved Questions
68+
[unresolved-questions]: #unresolved-questions
69+
70+
- What parts of the design do you expect to be resolved before this gets merged?
71+
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.
72+
73+
# Spec. Changes (OPTIONAL)
74+
[spec-changes]: #spec-changes
75+
This change will involve some spec changes for the new flag.
76+
77+
# History
78+
[history]: #history
79+
80+
<!--
81+
## Amended
82+
### Meta
83+
[meta-1]: #meta-1
84+
- Name: (fill in the amendment name: Variable Rename)
85+
- Start Date: (fill in today's date: YYYY-MM-DD)
86+
- Author(s): (Github usernames)
87+
- Amendment Pull Request: (leave blank)
88+
89+
### Summary
90+
91+
A brief description of the changes.
92+
93+
### Motivation
94+
95+
Why was this amendment necessary?
96+
--->

0 commit comments

Comments
 (0)