mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
refactor(AWS Deploy): Deprecate function option in deploy command
Co-authored-by: Piotr Grzesik <pj.grzesik@gmail.com>
This commit is contained in:
parent
20612ff85c
commit
d861d119ef
@ -32,6 +32,14 @@ Note:
|
||||
- Configuration setting is ineffective for deprecations reported before service configuration is read.
|
||||
- `SLS_DEPRECATION_DISABLE` env var and `disabledDeprecations` configuration setting remain respected, and no errors will be thrown for mentioned deprecation coodes.
|
||||
|
||||
<a name="CLI_DEPLOY_FUNCTION_OPTION"><div> </div></a>
|
||||
|
||||
## CLI `--function`/`-f` option for `deploy` command
|
||||
|
||||
Deprecation code: `CLI_DEPLOY_FUNCTION_OPTION'`
|
||||
|
||||
Starting with v3.0.0, `--function` or `-f` option for `deploy` command will be removed. In order to deploy a single function, please use `deploy function` command instead.
|
||||
|
||||
<a name="CHANGE_OF_DEFAULT_RUNTIME_TO_NODEJS14X"><div> </div></a>
|
||||
|
||||
## Change of default runtime to `nodejs14.x`
|
||||
|
||||
@ -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': {
|
||||
|
||||
@ -29,6 +29,17 @@ class Deploy {
|
||||
};
|
||||
|
||||
this.hooks = {
|
||||
'initialize': () => {
|
||||
const isDeployCommand =
|
||||
this.serverless.processedInput.commands.length === 1 &&
|
||||
this.serverless.processedInput.commands[0] === 'deploy';
|
||||
if (isDeployCommand && this.options.function) {
|
||||
this.serverless.logDeprecation(
|
||||
'CLI_DEPLOY_FUNCTION_OPTION',
|
||||
'Starting with v3.0.0, `--function` or `-f` option for `deploy` command will be removed. In order to deploy a single function, please use `deploy function` command instead.'
|
||||
);
|
||||
}
|
||||
},
|
||||
'before:deploy:deploy': async () => {
|
||||
const provider = this.serverless.service.provider.name;
|
||||
if (!this.serverless.getProvider(provider)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user