Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 17, 2025

Overview

The webiny deploy command 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:

  • Deploy a single app: yarn webiny deploy core --env dev
  • Deploy all apps: yarn webiny deploy --env dev

After

You can now deploy multiple apps in one command:

# Deploy specific apps together
yarn webiny deploy core api --env dev

# Still works - single app
yarn webiny deploy core --env dev

# Still works - all apps
yarn webiny deploy --env dev

Implementation Details

1. Array Parameter Support

Added an explicit array: true property to the command parameter definition to support multiple app names. Updated GetCliRunnerService to properly handle array parameters by:

  • Added array?: boolean property to ICommandParamDefinition interface
  • Reading the array property from parameter definitions
  • Automatically configuring them as arrays when registering with yargs
  • Constructing command strings with .. suffix for array parameters (e.g., [apps..])

2. Handler Logic

The command handler checks if apps are specified and deploys them sequentially:

if (params.apps && params.apps.length > 0) {
    for (const app of params.apps) {
        await this.deployApp({ ...params, app });
    }
} else {
    // Deploy all apps (existing behavior)
}

3. Simplified Type Design

Uses a single, clean interface for deploy parameters:

  • IDeployCommandParams - Single interface with optional apps?: AppName[] parameter
  • IDeploySingleAppParams - Internal method deploys single app

The apps parameter 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: true property 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 - Added array property to parameter definition interface
  • packages/cli-core/src/features/DeployCommand/DeployCommand.ts - Core command logic with simplified interface
  • packages/cli-core/src/services/GetCliRunnerService/GetCliRunnerService.ts - Array parameter handling
  • packages/cli-core/src/features/DeployCommand/deployOutputs/BaseDeployOutput.ts - Type consistency

Closes #[issue-number]

[!WARNING]

Original prompt

enable the webiny deploy command to also support yarn webiny core api --env dev

So in other words, from only being able to specify one app (like 'core'), this time we can specify multiple, like in this case 'core api'.

Check the DeployCommand.ts file, there the changes should happen.

LFG!


💡 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.

Copilot AI changed the title [WIP] Enable webiny deploy command for multiple apps Enable multi-app deploy support in webiny deploy command Oct 17, 2025
Copilot AI requested a review from adrians5j October 17, 2025 11:22
Copilot finished work on behalf of adrians5j October 17, 2025 11:22
@Pavel910 Pavel910 added this to the 5.44.0 milestone Oct 17, 2025
Copy link
Member

@adrians5j adrians5j left a 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..",
Copy link
Member

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?

Copy link
Contributor Author

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

Copilot AI requested a review from adrians5j October 17, 2025 12:02
Copilot finished work on behalf of adrians5j October 17, 2025 12:02
Copy link
Member

@adrians5j adrians5j left a 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",
Copy link
Member

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[].

Copy link
Contributor Author

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

Copilot AI requested a review from adrians5j October 17, 2025 16:11
Copilot finished work on behalf of adrians5j October 17, 2025 16:11
@adrians5j adrians5j marked this pull request as ready for review October 21, 2025 12:56
@adrians5j adrians5j merged commit ebef023 into next Oct 21, 2025
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants