Skip to content

Commit

Permalink
configure deprecation message for deploy function option
Browse files Browse the repository at this point in the history
  • Loading branch information
jkklapp committed Apr 30, 2021
1 parent c8ef7ce commit 998274a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docs/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,3 +363,12 @@ Please use `onUnauthenticatedRequest` instead. `allowUnauthenticated` will be re
Deprecation code: `BIN_SERVERLESS`

Please use `bin/serverless.js` instead. `bin/serverless` will be removed with v2.0.0

<a name="CLI_DEPLOY_FUNCTION_OPTION"><div>&nbsp;</div></a>

## CLI deploy command function option deprecated

Deprecation code: `CLI_DEPLOY_FUNCTION_OPTION'`

The `--function` or `-f` option in `deploy` command has been deprecated and will be removed in the next major release (3.0.0). Please use
`sls deploy function` command instead.
2 changes: 1 addition & 1 deletion lib/cli/commands-schema/aws-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ commands.set('deploy', {
type: 'boolean',
},
'function': {
usage: "Function name. Deploys a single function (see 'deploy function')",
usage: "Function name. Deploys a single function. DEPRECATED: use 'deploy function' instead.",
shortcut: 'f',
},
'aws-s3-accelerate': {
Expand Down
5 changes: 5 additions & 0 deletions lib/plugins/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ class Deploy {
throw new ServerlessError(errorMessage);
}
if (this.options.function) {
this.serverless.logDeprecation(
'CLI_DEPLOY_FUNCTION_OPTION',
'The `--function` or `-f` option for `deploy` command has been' +
' deprecated and will be removed in the next major release (3.0.0). Please use `sls deploy function` command instead.'
);
// If the user has given a function parameter, spawn a function deploy
// and terminate execution right afterwards. We did not enter the
// deploy lifecycle yet, so nothing has to be cleaned up.
Expand Down

0 comments on commit 998274a

Please sign in to comment.