-
Couldn't load subscription status.
- Fork 657
Enable multi-app deploy support in webiny deploy command #4743
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
Conversation
Co-authored-by: adrians5j <[email protected]>
Co-authored-by: adrians5j <[email protected]>
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.
| { | ||
| name: "app", | ||
| description: "Name of the app (core, admin, or api)", | ||
| name: "apps..", |
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 use this weird syntax?
Can't we just make it array: true?
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.
Changed to use array: true property instead of the apps.. syntax. The parameter definition now explicitly declares array: true, which is cleaner and more intuitive. Commit: ada5145 → new commit
Co-authored-by: adrians5j <[email protected]>
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.
| name: "app", | ||
| description: "Name of the app (core, admin, or api)", | ||
| type: "string" | ||
| name: "apps", |
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.
I'd rather have a single app parameter, that is a single app or an array of apps. Or maybe even... Let's have it always be an array? Like apps: AppName[].
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.
Simplified to always use apps?: AppName[] as an optional array in a single IDeployCommandParams interface. Removed the separate IDeployNoAppParams and IDeployWithAppParams interfaces. Commit: 2568d72 → new commit
Co-authored-by: adrians5j <[email protected]>
Overview
The
webiny deploycommand now supports deploying multiple apps in a single command invocation, enabling developers to deploy specific app combinations without having to run separate commands or deploy all apps.What Changed
Before
The deploy command only supported two modes:
yarn webiny deploy core --env devyarn webiny deploy --env devAfter
You can now deploy multiple apps in one command:
Implementation Details
1. Array Parameter Support
Added an explicit
array: trueproperty to the command parameter definition to support multiple app names. UpdatedGetCliRunnerServiceto properly handle array parameters by:array?: booleanproperty toICommandParamDefinitioninterfacearrayproperty from parameter definitions..suffix for array parameters (e.g.,[apps..])2. Handler Logic
The command handler checks if apps are specified and deploys them sequentially:
3. Simplified Type Design
Uses a single, clean interface for deploy parameters:
IDeployCommandParams- Single interface with optionalapps?: AppName[]parameterIDeploySingleAppParams- Internal method deploys single appThe
appsparameter is always an optional array. When undefined or empty, all apps are deployed. When specified with one or more values, only those apps are deployed.Benefits
✅ Improved Developer Experience - Deploy exactly what you need without extra commands
✅ Fully Backward Compatible - All existing workflows continue to work
✅ Type Safe - Full TypeScript type checking maintained
✅ Clean API - Uses explicit
array: trueproperty and simplified interface design✅ Simple & Intuitive - Single parameter interface with optional array, no discriminated unions
Files Changed
packages/cli-core/src/abstractions/features/Command.ts- Addedarrayproperty to parameter definition interfacepackages/cli-core/src/features/DeployCommand/DeployCommand.ts- Core command logic with simplified interfacepackages/cli-core/src/services/GetCliRunnerService/GetCliRunnerService.ts- Array parameter handlingpackages/cli-core/src/features/DeployCommand/deployOutputs/BaseDeployOutput.ts- Type consistencyCloses #[issue-number]
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.