forked from tom-smith-okta/node-lambda-oauth2-jwt-authorizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
51 lines (45 loc) · 1.15 KB
/
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
50
51
'use strict';
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
if (grunt.option('region') === undefined){
grunt.option('region', 'us-west-2');
}
if (grunt.option('account-id') === undefined){
return grunt.fail.fatal('--account-id is required', 1);
}
grunt.initConfig({
lambda_invoke: {
default: {
package: 'oauth2-jwt-authorizer',
options: {
file_name: 'index.js',
handler: 'handler',
event: './test/event.json',
},
}
},
lambda_deploy: {
default: {
package: 'oauth2-jwt-authorizer',
options: {
file_name: 'index.js',
handler: 'handler',
},
arn: 'arn:aws:lambda:' + grunt.option('region') + ':' + grunt.option('account-id') +
':function:oauth2-jwt-authorizer',
},
},
lambda_package: {
default: {
package: 'oauth2-jwt-authorizer',
},
},
env: {
prod: {
NODE_ENV: 'production',
},
},
});
grunt.registerTask('deploy', ['env:prod', 'lambda_package', 'lambda_deploy']);
grunt.registerTask('test', ['lambda_invoke']);
};