-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
37 lines (31 loc) · 958 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
var BasePlugin = require('ember-cli-deploy-plugin');
var shell = require('./utils/shell');
module.exports = {
name: require('./package').name,
createDeployPlugin: function (options) {
var DeployPlugin = BasePlugin.extend({
name: options.name,
requiredConfig: ['bucket', 'region'],
defaultConfig: {
ci: false
},
didDeploy: function () {
let bucket = this.readConfig('bucket');
let region = this.readConfig('region');
let ci = this.readConfig('ci');
let log = this.log.bind(this);
let ciFlag = '';
if (ci) {
ciFlag = '--ci';
}
return shell.runCommand(
`npx -p @storybook/storybook-deployer storybook-to-aws-s3 --bucket-path=${bucket} --aws-profile=NONE ${ciFlag} --s3-sync-options="--region=${region} --delete"`,
true,
log
);
},
});
return new DeployPlugin();
},
};