forked from kopertop/lambda-jwt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
49 lines (46 loc) · 1016 Bytes
/
Gruntfile.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
42
43
44
45
46
47
48
49
/**
* Grunt Uploader for Lambda scripts
* @author: Chris Moyer <[email protected]>
*/
'use strict';
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
if(grunt.option('account-id') === undefined){
return grunt.fail.fatal('--acount-id is required', 1);
}
var path = require('path');
grunt.initConfig({
lambda_invoke: {
default: {
package: 'jwtAuthorize',
options: {
file_name: 'index.js',
handler: 'handler',
event: 'event.json',
},
}
},
lambda_deploy: {
default: {
package: 'jwtAuthorize',
options: {
file_name: 'index.js',
handler: 'handler',
},
arn: 'arn:aws:lambda:us-east-1:' + grunt.option('account-id') + ':function:jwtAuthorize',
},
},
lambda_package: {
default: {
package: 'jwtAuthorize',
},
},
env: {
prod: {
NODE_ENV: 'production',
},
},
});
grunt.registerTask('deploy', ['env:prod', 'lambda_package', 'lambda_deploy']);
grunt.registerTask('test', ['lambda_invoke']);
};