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
Background
In
packages/cli/src/commands/deploy/baremetal.jsat line 96:// TODO: Allow option to pass --sides and only deploy select sides instead of all, alwaysThe
cedar deploy baremetalcommand always deploys all sides defined indeploy.toml(defaulting to['api', 'web']). There is no way to deploy only theapior only thewebside from the CLI.What needs to be done
Add a
--sidesCLI option tocedar deploy baremetalthat lets users specify which sides to deploy in a given run.Changes required
packages/cli/src/commands/deploy/baremetal.js— add the yargs option:packages/cli/src/commands/deploy/baremetal/baremetalHandler.js— filter the sides:The handler reads sides from
serverConfig.sides(line 23, defaulting to['api', 'web']). Whenyargs.sidesis provided, filter:Then use
sidesToDeployin 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