mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Move package code up and add createDeploymentArtifacts to topmost package command.
This commit is contained in:
parent
b2fe5b6aba
commit
6be0ba2f8f
@ -8,8 +8,6 @@ const generateCoreTemplate = require('./lib/generateCoreTemplate');
|
||||
const saveServiceState = require('./lib/saveServiceState');
|
||||
const saveCompiledTemplate = require('./lib/saveCompiledTemplate');
|
||||
const mergeIamTemplates = require('./lib/mergeIamTemplates');
|
||||
const zipService = require('./lib/zipService');
|
||||
const packageService = require('./lib/packageService');
|
||||
|
||||
class AwsPackage {
|
||||
constructor(serverless, options) {
|
||||
@ -23,8 +21,6 @@ class AwsPackage {
|
||||
|
||||
Object.assign(
|
||||
this,
|
||||
packageService,
|
||||
zipService,
|
||||
generateCoreTemplate,
|
||||
mergeIamTemplates,
|
||||
generateArtifactDirectoryName,
|
||||
@ -71,9 +67,6 @@ class AwsPackage {
|
||||
'package:setupProviderConfiguration': () => BbPromise.bind(this)
|
||||
.then(this.mergeIamTemplates),
|
||||
|
||||
'package:createDeploymentArtifacts': () => BbPromise.bind(this)
|
||||
.then(this.packageService),
|
||||
|
||||
'before:package:compileFunctions': () => BbPromise.bind(this)
|
||||
.then(this.generateArtifactDirectoryName),
|
||||
|
||||
|
||||
@ -1,9 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
const BbPromise = require('bluebird');
|
||||
const path = require('path');
|
||||
const zipService = require('./lib/zipService');
|
||||
const packageService = require('./lib/packageService');
|
||||
|
||||
class Package {
|
||||
constructor(serverless, options) {
|
||||
this.serverless = serverless;
|
||||
this.options = options;
|
||||
this.servicePath = this.serverless.config.servicePath || '';
|
||||
this.packagePath = this.options.package ||
|
||||
this.serverless.service.package.path ||
|
||||
path.join(this.servicePath || '.', '.serverless');
|
||||
|
||||
Object.assign(
|
||||
this,
|
||||
packageService,
|
||||
zipService
|
||||
);
|
||||
|
||||
this.commands = {
|
||||
package: {
|
||||
@ -33,6 +48,11 @@ class Package {
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
this.hooks = {
|
||||
'package:createDeploymentArtifacts': () => BbPromise.bind(this)
|
||||
.then(this.packageService),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user