-
Notifications
You must be signed in to change notification settings - Fork 127
/
Copy pathgoogleRemove.js
41 lines (34 loc) · 1.12 KB
/
googleRemove.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
37
38
39
40
41
'use strict';
const BbPromise = require('bluebird');
const validate = require('../shared/validate');
const setDefaults = require('../shared/utils');
const setDeploymentBucketName = require('../shared/setDeploymentBucketName');
const emptyDeploymentBucket = require('./lib/emptyDeploymentBucket');
const removeDeployment = require('./lib/removeDeployment');
const monitorDeployment = require('../shared/monitorDeployment');
class GoogleRemove {
constructor(serverless, options) {
this.serverless = serverless;
this.options = options;
this.provider = this.serverless.getProvider('google');
Object.assign(
this,
validate,
setDefaults,
setDeploymentBucketName,
emptyDeploymentBucket,
removeDeployment,
monitorDeployment
);
this.hooks = {
'before:remove:remove': () =>
BbPromise.bind(this)
.then(this.validate)
.then(this.setDefaults)
.then(this.setDeploymentBucketName),
'remove:remove': () =>
BbPromise.bind(this).then(this.emptyDeploymentBucket).then(this.removeDeployment),
};
}
}
module.exports = GoogleRemove;