cli
cli copied to clipboard
[feature] allow specify a project and service while deploy
Is your feature request related to a problem? Please describe.
When we need to deploy a project, we usually need to interactively select which project and which service.
Z:\laoshubaby\static\pages\tracesmap>zeabur
INFO Select one project to deploy your service.
? Select project pages
INFO Only one environment in current project, select <production> automatically
INFO Select one service to deploy or create a new one.
? Select a service tracesmap
Current working directory: Z:\laoshubaby\static\pages\tracesmap
Service deployed successfully, you can access it via:
https://dash.zeabur.com/projects/6*d/services/6*1?envID=6*5
~~(In case you were confused: Z is because this is the mounted webdav path and actually all resources are on AWS)~~
User have to select manually every time, and sometimes fat-finger’ll make the wrong choice if you’re quick.
Describe the solution you'd like
Users can query the ID (or name) of the required project and service through zeabur project list
and zeabur service list
in advance, and specify it directly when calling deployment
Z:\laoshubaby\static\pages\tracesmap>zeabur project list
ID NAME DESCRIPTION CREATED AT
---------------------------+---------+-------------+-----------------
6*d pages 113 day(s) ago
6*1 ochenen 1 hour(s) ago
Z:\laoshubaby\static\pages\tracesmap>zeabur service list
ID NAME TYPE CREATEDAT
---------------------------+-----------+------+-----------------
6**1 tracesmap GIT 11 hour(s) ago
6*2 ogflab GIT 2 hour(s) ago
Z:\laoshubaby\static\pages\tracesmap>zeabur --project 6*d --service 6**1
Describe alternatives you've considered
No response
Additional context
Maybe you actually have this function, but I am not familiar with golang, and it is impossible to check all your codes to see which arguments you can currently support parsing (unfortunately, I have only used py's argparse) I have checked your documentation related to CLI deployment and found that there is no mention of this type of argument:
- https://zeabur.com/docs/deploy/deploy-in-cli.en-US
- https://github.com/zeabur/cli/blob/main/docs/development_guide.md
- https://github.com/zeabur/cli/blob/main/README.md
Among others, I noticed that your zeabur context set project
or zeabur context set project --name <project-name>
might behave like this
Z:\laoshubaby\static\pages\tracesmap>zeabur context set project
? Select project pages
? Project is already set(pages), do you want to change it?(Once changed, the environment and service will be cleared.) (Y/n)
It seems that it does not specify which project/service will be automatically selected for future deployment in the current directory, but changes the already deployed online services.
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Thanks for the suggestion! It's on our roadmap and will be implemented in the near future.