-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.js
38 lines (32 loc) · 898 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
37
38
'use strict';
const { bundleGems, excludePackage } = require('./lib/bundle');
class ServerlessRubyBundler {
get options() {
const options = Object.assign(
{
use_docker: false,
ignore_gemfile_lock: false
},
(this.serverless.service.custom &&
this.serverless.service.custom.rubyLayer) ||
{}
);
return options;
}
constructor(serverless) {
this.serverless = serverless;
this.servicePath = this.serverless.config.servicePath;
this.warningLogged = false;
this.commands = {
rubylayer: {
lifecycleEvents: ['pack',],
},
};
this.hooks = {
'before:package:createDeploymentArtifacts': excludePackage.bind(this),
'after:package:createDeploymentArtifacts': bundleGems.bind(this),
'rubylayer:pack': bundleGems.bind(this),
};
}
}
module.exports = ServerlessRubyBundler;