forked from tedconf/ember-cli-deploy-front-end-builds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
36 lines (28 loc) · 950 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';
const BasePlugin = require('ember-cli-deploy-plugin');
const passwdUser = require('passwd-user');
const FrontEndBuildsNotifier = require('./lib/front-end-builds-notifier');
module.exports = {
name: require('./package').name,
createDeployPlugin(options) {
const homedir = passwdUser.sync(process.getuid()).homeDirectory;
const DeployPlugin = BasePlugin.extend({
name: options.name,
// eslint-disable-next-line ember/avoid-leaking-state-in-ember-objects
defaultConfig: {
privateKey: homedir + '/.ssh/id_rsa',
requestOptions: {},
},
// eslint-disable-next-line ember/avoid-leaking-state-in-ember-objects
requiredConfig: ['app', 'endpoint'],
didUpload(context) {
const notifier = new FrontEndBuildsNotifier({
plugin: this,
context,
});
return notifier.notify();
},
});
return new DeployPlugin();
},
};