Skip to content

feat(cli): add --sides flag to cedar deploy baremetal #1593

@lisa-assistant

Description

@lisa-assistant

Background

In packages/cli/src/commands/deploy/baremetal.js at line 96:

// TODO: Allow option to pass --sides and only deploy select sides instead of all, always

The cedar deploy baremetal command always deploys all sides defined in deploy.toml (defaulting to ['api', 'web']). There is no way to deploy only the api or only the web side from the CLI.

What needs to be done

Add a --sides CLI option to cedar deploy baremetal that lets users specify which sides to deploy in a given run.

Changes required

packages/cli/src/commands/deploy/baremetal.js — add the yargs option:

yargs.option('sides', {
  describe: 'Which sides to deploy (defaults to all sides in deploy.toml)',
  type: 'array',
  choices: ['api', 'web'],
})

packages/cli/src/commands/deploy/baremetal/baremetalHandler.js — filter the sides:

The handler reads sides from serverConfig.sides (line 23, defaulting to ['api', 'web']). When yargs.sides is provided, filter:

const sidesToDeploy = yargs.sides?.length
  ? serverConfig.sides.filter((s) => yargs.sides.includes(s))
  : serverConfig.sides

Then use sidesToDeploy in the deploy loop at line 398 (for (const side of serverConfig.sides)).

Use case

Useful for deployments where the API and web side are deployed at different cadences, or for partial rollbacks where only one side needs redeploying.

File

packages/cli/src/commands/deploy/baremetal.js, line 96

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions