-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support env var interpolation in baremetal deploy.toml #7962
feat: Support env var interpolation in baremetal deploy.toml #7962
Conversation
Hey @thedavidprice this is my first contribution to redwood. Love the project 😄. Not sure why all the checks are broken. Did I skip a step? |
@jaiakt well, in that case, I'm extra excited about this PR. Grateful you'd take the time to contribute. CI: there are steps we need, as maintainers, manually take with every new PR. For the most part, pay attention to CI but don't focus much on it until the code review is underway. And there's a lot going on, so don't hesitate to ask for direction and/or help! (Note: in this case I'm working on yarn.lock being out of sync. Updating shortly) |
One thing I was thinking about is that this could potentially be breaking (for just the deploy process) if any users have strings that look like env variable interpolations (although it would be strange to have strings of the format ${} in constants) 😓. Not sure what the best way to avoid this is. Maybe we want to add an optional parameter which enables this behavior? |
This is amazing, thanks so much! We'd love to have this update discussed in the docs as well, how do you feel about adding a note or two in there about this new functionality? |
@cannikin added a note in the docs. LMK if that looks good |
This is amazing, I've wanted this feature for a while now but didn't have time to look into adding it! Thanks so much. What do you think about having interpolation be enabled by default, if not just always there (no option needed to disable)? I feel like you wouldn't accidentally add Unless maybe people have some CI system somewhere where they'd want to put a variable in |
You'll see in our checks that the first one is failing, about "Check test project fixture." Can you run this command and commit any changes? (You can ignore changes to any db migration files):
|
I personally think this should be enabled by default (and probably always there). I was just a bit nervous adding a potentially breaking change. I do agree that the chances of someone having |
1a0bcdf
to
a49abd0
Compare
Hmm I ran this command and am now changing a lot of files that probably shouldn't be touched by this PR. I'm assuming they are stale as of previous changes? |
0e11914
to
4cb56e9
Compare
Hmm, possibly. I just merged in the latest If anything else shows as changed can you screenshot me a list, or maybe paste a diff into https://gist.github.com ? |
82b4a9e
to
2b32fa3
Compare
@cannikin the changed files are in the changed files of this PR. It seems like some package versions in |
Oh nice just updated to main and it looks like those file changes are gone! |
Ah yeah just learned how to run tests lol. Fixed the test! |
Thanks so much! This should auto-merge once the CI is done running! |
This is based on #3708.
Context aka Why?
Some settings in the deploy config might need to be different based on what machine is deploying (for example the private key path). This adds env variable interpolation similar to what
redwood.toml
parsing does currently so that some fields can be loaded from.env
.What does this do?
Adds support for env var interpolation. Example syntax:
This will do the following:
set value of host from the env var
$HOST
, and interpolate itread the value of repo from
$REPO
, but fallback togit://github.com
if not present. Note that the fallback has to be a stringread path from
$PATH
but fallback to the default if not presentNote: This could be potentially breaking for deploy configs with strings of the format
${}
. I've gated this behavior behind the yarginterpretEnvVariables
which can be defaulted with the environment variableDEPLOY_INTERPRET_ENV_VARIABLES
. If this is too complicated, I can simplify it 😄