File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,17 @@ module.exports = {
77 setDefaults ( ) {
88 this . options . stage = _ . get ( this , 'options.stage' )
99 || 'dev' ;
10- this . options . region = _ . get ( this , 'options.region' )
11- || 'us-central1' ;
1210 this . options . runtime = _ . get ( this , 'options.runtime' )
1311 || 'nodejs8' ;
1412
13+ // serverless framework is hard-coding us-east-1 region from aws
14+ // this is temporary fix for multiple regions
15+ const region = _ . get ( this , 'options.region' )
16+ || _ . get ( this , 'serverless.service.provider.region' ) ;
17+
18+ this . options . region = ( ! region || region === 'us-east-1' )
19+ ? 'us-central1' : region ;
20+
1521 return BbPromise . resolve ( ) ;
1622 } ,
1723} ;
Original file line number Diff line number Diff line change @@ -34,5 +34,16 @@ describe('Utils', () => {
3434 expect ( googleCommand . options . runtime ) . toEqual ( 'nodejs6' ) ;
3535 } ) ;
3636 } ) ;
37+
38+
39+ it ( 'should set the provider values for stage and region if provided' , ( ) => {
40+ googleCommand . serverless . service . provider = {
41+ region : 'my-region' ,
42+ } ;
43+
44+ return googleCommand . setDefaults ( ) . then ( ( ) => {
45+ expect ( googleCommand . options . region ) . toEqual ( 'my-region' ) ;
46+ } ) ;
47+ } ) ;
3748 } ) ;
3849} ) ;
You can’t perform that action at this time.
0 commit comments