-
Notifications
You must be signed in to change notification settings - Fork 5.7k
CLI: Deprecate sls deploy -f <function-name> #9312
Copy link
Copy link
Closed
Labels
cat/clicat/deploymentdeprecationDeprecation proposal (breaking with next major)Deprecation proposal (breaking with next major)help wanted
Milestone
Description
Use case description
There's a dedicated CLI command deploy function -f <function-name> for single function deployment. Still same can theoretically be achieved via deploy -f <function-name>.
It's problematic alias as both commands accept different options:
serverless/lib/cli/commands-schema/aws-service.js
Lines 10 to 36 in 712a569
options: { 'conceal': { usage: 'Hide secrets from the output (e.g. API Gateway key values)', type: 'boolean', }, 'package': { usage: 'Path of the deployment package', shortcut: 'p', }, 'verbose': { usage: 'Show all stack events during deployment', shortcut: 'v', type: 'boolean', }, 'force': { usage: 'Forces a deployment to take place', type: 'boolean', }, 'function': { usage: "Function name. Deploys a single function (see 'deploy function')", shortcut: 'f', }, 'aws-s3-accelerate': { usage: 'Enables S3 Transfer Acceleration making uploading artifacts much faster.', type: 'boolean', }, }, serverless/lib/cli/commands-schema/aws-service.js
Lines 52 to 65 in 712a569
'function': { usage: 'Name of the function', shortcut: 'f', required: true, }, 'force': { usage: 'Forces a deployment to take place', type: 'boolean', }, 'update-config': { usage: 'Updates function configuration, e.g. Timeout or Memory Size without deploying code', shortcut: 'u', type: 'boolean', },
Also they're backed with different lifecycle events, therefore there's a wide room for both variants to not behave perfectly same.
Ideally we should drop support for sls deploy -f functioname
Proposed solution
- Remove
functionoption from schema ofdeploycommand - Show deprecation if user invokes
sls deploy --function. I believe it should be configured indeployinternal plugin, in newly introducedinitializehook
PR's welcome
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
cat/clicat/deploymentdeprecationDeprecation proposal (breaking with next major)Deprecation proposal (breaking with next major)help wanted