@@ -32,6 +32,13 @@ public function deploy(int $deploymentId, string $environment, array $awsCredent
32
32
if ($ input ->hasOption ('force ' )) {
33
33
$ options [] = '--force ' ;
34
34
}
35
+ if ($ input ->hasOption ('config ' ) && $ input ->getOption ('config ' )) {
36
+ $ configFile = (string ) $ input ->getOption ('config ' );
37
+ $ options [] = '--config ' ;
38
+ $ options [] = $ configFile ;
39
+ } else {
40
+ $ configFile = null ;
41
+ }
35
42
36
43
$ newLogs = '' ;
37
44
$ entireSlsOutput = '' ;
@@ -89,7 +96,7 @@ public function deploy(int $deploymentId, string $environment, array $awsCredent
89
96
90
97
$ hasChanges = ! str_contains ($ newLogs , 'No changes to deploy. Deployment skipped. ' );
91
98
if ($ hasChanges ) {
92
- $ outputs = $ this ->retrieveOutputs ($ environment , $ awsCredentials );
99
+ $ outputs = $ this ->retrieveOutputs ($ environment , $ awsCredentials, $ configFile );
93
100
94
101
$ region = $ outputs ['region ' ];
95
102
$ stackName = $ outputs ['stack ' ];
@@ -115,9 +122,15 @@ public function deploy(int $deploymentId, string $environment, array $awsCredent
115
122
* @return array<string, string>
116
123
* @throws Exception
117
124
*/
118
- private function retrieveOutputs (string $ environment , array $ awsCredentials ): array
125
+ private function retrieveOutputs (string $ environment , array $ awsCredentials, ? string $ configFile ): array
119
126
{
120
- $ process = $ this ->serverlessExec ('info ' , $ environment , $ awsCredentials , []);
127
+ $ options = [];
128
+ if ($ configFile ) {
129
+ $ options [] = '--config ' ;
130
+ $ options [] = $ configFile ;
131
+ }
132
+
133
+ $ process = $ this ->serverlessExec ('info ' , $ environment , $ awsCredentials , $ options );
121
134
$ process ->join ();
122
135
$ infoOutput = buffer ($ process ->getStdout ());
123
136
// Remove non-ASCII characters
0 commit comments