@@ -32,6 +32,13 @@ public function deploy(int $deploymentId, string $environment, array $awsCredent
3232 if ($ input ->hasOption ('force ' )) {
3333 $ options [] = '--force ' ;
3434 }
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+ }
3542
3643 $ newLogs = '' ;
3744 $ entireSlsOutput = '' ;
@@ -89,7 +96,7 @@ public function deploy(int $deploymentId, string $environment, array $awsCredent
8996
9097 $ hasChanges = ! str_contains ($ newLogs , 'No changes to deploy. Deployment skipped. ' );
9198 if ($ hasChanges ) {
92- $ outputs = $ this ->retrieveOutputs ($ environment , $ awsCredentials );
99+ $ outputs = $ this ->retrieveOutputs ($ environment , $ awsCredentials, $ configFile );
93100
94101 $ region = $ outputs ['region ' ];
95102 $ stackName = $ outputs ['stack ' ];
@@ -115,9 +122,15 @@ public function deploy(int $deploymentId, string $environment, array $awsCredent
115122 * @return array<string, string>
116123 * @throws Exception
117124 */
118- private function retrieveOutputs (string $ environment , array $ awsCredentials ): array
125+ private function retrieveOutputs (string $ environment , array $ awsCredentials, ? string $ configFile ): array
119126 {
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 );
121134 $ process ->join ();
122135 $ infoOutput = buffer ($ process ->getStdout ());
123136 // Remove non-ASCII characters
0 commit comments