-
Notifications
You must be signed in to change notification settings - Fork 970
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
g secret: raw output #4523
g secret: raw output #4523
Conversation
@Tobbe Nice! Took this for a quick spin and I'm not sure it's doing quite what you want yet (though I may not be understanding the example). When I ran your example (
|
@jtoar That's weird. It even works on Windows for me |
@Tobbe I'll try it out locally |
I'm running it from within the RW fw codebase, but that's supposed to be the same, right?
|
I tried it on GitPod too, and this is what ends up in my .env file
So |
@Tobbe Yeah I'd think |
Not as nice, but it works if you do:
or, if you're in the root of your project:
|
Aha! yarn has a
|
I don’t really know enough about logon vs not login shells and when tty is true or false, but if you think this looks good, sounds good! |
@jtoar I just now looked. We're not running it through yarn when using |
@Tobbe nah that's not related to this PR, I've seen that on a few others lately. Not sure what to do about it yet 🤔 |
This works in git-bash on Windos. But it does not work in PowerShell
Does that mean it's a no-go on this PR? What's our current stance on Windows support requirements? |
Another option is to just add a flag for it. Is that better? Personally I have always used git-bash, and it's also what we recommend in our windows cookbook recipe. But if we use PS or Cmd for Windows CI we need to figure out something for that. @dac09 @jtoar what do we use? |
Hey @Tobbe sorry to throw water onto your beautifully tested tty flame, but I'm not sure what the real benefit here is? If someone is generating a secret - they'll do it once really. I can't see why someone would generate a new secret every time in a pipeline? |
The usecase is to streamline project setup for existing projects for new users. I wanted to fix the instructions for getting started with the tutorial app https://github.com/redwoodjs/redwood-tutorial. They're currently broken. And I wanted to just be able to add another one-liner to the list that currently looks like this:
I want it to instead be
And secondly I imagine it would also be useful for e2e test setup because it makes it easy to programatically generate the secret during test setup. |
We decided on a meeting today that we want this, but it should be controlled by a command line switch instead of looking at |
baa0a13
to
fecc272
Compare
Thanks @Tobbe What do you think about documenting this somewhere — especially use-case I'm ambivalent so consider a fwiw... |
Thanks for the nudge @thedavidprice. Turns out we didn't have any docs at all for |
Yeah it was only documented in the dbAuth docs, telling people how to create a new one for a new environment. Forgot about the CLI commands doc page! |
This PR makes the
yarn redwood generate secret
command output just the secret, no extra information messaging, when used in a pipeline.It allows you to do things like
yarn --silent rw g secret > myfile
to print just the secret to a file.Or more relevant for dbAuth:
To append the needed environment variable to the user's .env file
(Updated to add
--silent
)