serverless-aliyun-function-compute-wnj
Version:
Provider plugin for the Serverless Framework v1.x which adds support for Aliyun Function Compute
47 lines (34 loc) • 1.27 kB
JavaScript
;
/* eslint no-use-before-define: 0 */
const path = require('path');
const BbPromise = require('bluebird');
module.exports = {
saveCreateTemplateFile() {
const packagePath =
path.join(this.serverless.config.servicePath || '.', '.serverless');
const filePath = path.join(packagePath,'configuration-template-create.json');
this.serverless.utils.writeFileSync(filePath,
this.serverless.service.provider.compiledConfigurationTemplate);
return BbPromise.resolve();
},
saveUpdateTemplateFile() {
const packagePath =
path.join(this.serverless.config.servicePath || '.', '.serverless');
const filePath = path.join(packagePath, 'configuration-template-update.json');
this.serverless.utils.writeFileSync(filePath,
this.serverless.service.provider.compiledConfigurationTemplate);
return BbPromise.resolve();
},
saveServerlessConfigFile() {
const packagePath =
path.join(this.serverless.config.servicePath || '.');
const filePath = path.join(packagePath, 'serverless-config.json');
this.serverless.utils.writeFileSync(filePath,
{
"region": this.options.region,
"stage": this.options.stage
}
);
return BbPromise.resolve();
},
};