(serverless, options)
| 3 | |
| 4 | class Deploy { |
| 5 | constructor(serverless, options) { |
| 6 | this.serverless = serverless |
| 7 | this.options = options || {} |
| 8 | this.commands = { |
| 9 | deploy: { |
| 10 | ...cliCommandsSchema.get('deploy'), |
| 11 | commands: { |
| 12 | function: { |
| 13 | ...cliCommandsSchema.get('deploy function'), |
| 14 | }, |
| 15 | list: { |
| 16 | ...cliCommandsSchema.get('deploy list'), |
| 17 | |
| 18 | commands: { |
| 19 | functions: { |
| 20 | ...cliCommandsSchema.get('deploy list functions'), |
| 21 | }, |
| 22 | }, |
| 23 | }, |
| 24 | }, |
| 25 | }, |
| 26 | } |
| 27 | |
| 28 | this.hooks = { |
| 29 | 'before:deploy:deploy': async () => { |
| 30 | const provider = this.serverless.service.provider.name |
| 31 | if (!this.serverless.getProvider(provider)) { |
| 32 | const errorMessage = `The specified provider "${provider}" does not exist.` |
| 33 | throw new ServerlessError(errorMessage, 'INVALID_PROVIDER') |
| 34 | } |
| 35 | |
| 36 | if (!this.options.package && !this.serverless.service.package.path) { |
| 37 | await this.serverless.pluginManager.spawn('package') |
| 38 | } |
| 39 | }, |
| 40 | 'after:deploy:deploy': async () => { |
| 41 | return true |
| 42 | }, |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | export default Deploy |
nothing calls this directly
no test coverage detected