File tree Expand file tree Collapse file tree 3 files changed +53
-6
lines changed Expand file tree Collapse file tree 3 files changed +53
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " serverless-google-cloudfunctions" ,
2
+ "name" : " @alleypin/ serverless-google-cloudfunctions" ,
3
3
"version" : " 3.1.0" ,
4
- "description" : " Provider plugin for the Serverless Framework v1.x which adds support for Google Cloud Functions." ,
5
- "author" : " serverless.com" ,
6
- "repository" : " serverless/serverless-google-cloudfunctions" ,
7
- "homepage" : " https://github.com/serverless/serverless-google-cloudfunctions" ,
4
+ "description" : " Modified by AlleyPin, Provider plugin for the Serverless Framework v1.x which adds support for Google Cloud Functions." ,
5
+ "author" : " alleypin.com" ,
6
+ "repository" : {
7
+ "type" : " git" ,
8
+ "url" : " git+https://github.com/AlleyPin/serverless-google-cloudfunctions.git"
9
+ },
10
+ "homepage" : " https://github.com/AlleyPin/serverless-google-cloudfunctions.git" ,
8
11
"keywords" : [
9
12
" serverless" ,
10
13
" serverless framework" ,
74
77
"prettify:updated" : " pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write" ,
75
78
"test" : " jest"
76
79
},
77
- "license" : " MIT"
80
+ "license" : " MIT" ,
81
+ "bugs" : {
82
+ "url" : " https://github.com/AlleyPin/serverless-google-cloudfunctions/issues"
83
+ },
84
+ "main" : " index.js" ,
85
+ "directories" : {
86
+ "test" : " test"
87
+ }
78
88
}
Original file line number Diff line number Diff line change @@ -88,11 +88,13 @@ module.exports = {
88
88
const type = funcObject . events [ 0 ] . event . eventType ;
89
89
const path = funcObject . events [ 0 ] . event . path ; //eslint-disable-line
90
90
const resource = funcObject . events [ 0 ] . event . resource ;
91
+ const failurePolicy = funcObject . events [ 0 ] . event . failurePolicy ;
91
92
92
93
funcTemplate . properties . eventTrigger = { } ;
93
94
funcTemplate . properties . eventTrigger . eventType = type ;
94
95
if ( path ) funcTemplate . properties . eventTrigger . path = path ;
95
96
funcTemplate . properties . eventTrigger . resource = resource ;
97
+ if ( failurePolicy ) funcTemplate . properties . eventTrigger . failurePolicy = failurePolicy ;
96
98
}
97
99
98
100
this . serverless . service . provider . compiledConfigurationTemplate . resources . push ( funcTemplate ) ;
Original file line number Diff line number Diff line change @@ -568,6 +568,20 @@ describe('CompileFunctions', () => {
568
568
} ,
569
569
] ,
570
570
} ,
571
+ func3 : {
572
+ handler : 'func3' ,
573
+ events : [
574
+ {
575
+ event : {
576
+ eventType : 'foo' ,
577
+ resource : 'some-resource' ,
578
+ failurePolicy : {
579
+ retry : { } ,
580
+ } ,
581
+ } ,
582
+ } ,
583
+ ] ,
584
+ } ,
571
585
} ;
572
586
573
587
const compiledResources = [
@@ -608,6 +622,27 @@ describe('CompileFunctions', () => {
608
622
labels : { } ,
609
623
} ,
610
624
} ,
625
+ {
626
+ type : 'gcp-types/cloudfunctions-v1:projects.locations.functions' ,
627
+ name : 'my-service-dev-func3' ,
628
+ properties : {
629
+ entryPoint : 'func3' ,
630
+ parent : 'projects/myProject/locations/us-central1' ,
631
+ runtime : 'nodejs8' ,
632
+ function : 'my-service-dev-func3' ,
633
+ availableMemoryMb : 256 ,
634
+ timeout : '60s' ,
635
+ sourceArchiveUrl : 'gs://sls-my-service-dev-12345678/some-path/artifact.zip' ,
636
+ eventTrigger : {
637
+ eventType : 'foo' ,
638
+ resource : 'some-resource' ,
639
+ failurePolicy : {
640
+ retry : { } ,
641
+ } ,
642
+ } ,
643
+ labels : { } ,
644
+ } ,
645
+ } ,
611
646
] ;
612
647
613
648
return googlePackage . compileFunctions ( ) . then ( ( ) => {
You can’t perform that action at this time.
0 commit comments