-
Notifications
You must be signed in to change notification settings - Fork 251
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
Have logins to multiple platforms at the same time #819
Conversation
This is looking great! I realize not all of these are covered by this particular PR, but I imagine this could be a slightly larger refactoring, so I am sharing them here:
Extra:
(manually tested with multiple environments and things work great, thank you for working on this!) |
src/commands/deploy.rs
Outdated
long = "deployment-id", | ||
env = DEPLOYMENT_ID_ENV | ||
)] | ||
pub deployment_id: Option<String>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Deployment ID" for this is rather unintuitive.
Would you consider something like "environment' instead?
I would associate "deployment ID" with an instance of a deployed application that I am in the process of running spin deploy
for, rather than the environment I am logged into.
} | ||
|
||
impl DeployCommand { | ||
pub async fn run(self) -> Result<()> { | ||
let path = dirs::config_dir() | ||
.context("Cannot find config directory")? | ||
.join("spin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to put this under a fermyon
directory instead?
There might be other tools (that we build) that might need to share that configuration file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just following the existing convention. I don't have a strong opinion either way.
Ha ha, I considered
|
Fair enough on (again, not blocking this PR, could we use the same picker we have in |
a47ff77
to
af961c7
Compare
Also unrelated. After the deployment is complete, a user sees:
As we know the link of the platform UI, could we also print that as well? Something like:
|
3d21656
to
fe9a394
Compare
All right, this now includes I (slightly reluctantly) added a |
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
5ae331d
to
c1347c8
Compare
This follows on from @radu-matei expressing a wish to have Spin retain multiple logins that the user could select between without needing to go through a re-authentication each time.
In this proof of concept,
spin login
andspin deploy
gain an optional--deployment-id
argument.spin login --deployment-id
saves the login connection info under the given key (instead of in the default config);spin deploy --deployment-id
uses the URLs and credentials from the given key.NOTE: this is predicated on the login refactoring PR. So this PR includes all those commits. But the multiple environments one is just the last commit in here (pretty much just modifying the
config_file_path()
function to consider a new field).This POC doesn't really do any error handling, and handles environment choice on a per-command basis rather than switching between environments (so you have multiple saved but only one active at any time). But hopefully demonstrates how simple it should be to build it according to whatever UI we prefer.