Skip to content
This repository has been archived by the owner on Nov 19, 2022. It is now read-only.

Commit

Permalink
Support different stages, regions, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Jul 3, 2022
1 parent 714154b commit 8e936c0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const chalk = require('chalk');
class BrefLive {
constructor(serverless, options, utils) {
this.serverless = serverless;
this.options = options;
this.utils = utils;
this.commands = {
'bref:live': {
Expand Down Expand Up @@ -82,9 +83,12 @@ class BrefLive {
this.serverless.service.provider.environment.BREF_LIVE_ENABLE = '1';
const functionNames = this.serverless.service.getAllFunctions();
await Promise.all(functionNames.map((functionName) => {
return this.spawnAsync('serverless', [
'deploy', 'function', '--function', functionName
], {
const args = ['deploy', 'function', '--function', functionName];
if (this.options.stage) args.push('--stage', this.options.stage);
if (this.options.region) args.push('--region', this.options.region);
if (this.options.awsProfile) args.push('--aws-profile', this.options.awsProfile);
if (this.options.config) args.push('--config', this.options.config);
return this.spawnAsync('serverless', args, {
BREF_LIVE_ENABLE: '1',
});
}));
Expand Down

0 comments on commit 8e936c0

Please sign in to comment.