@@ -115,7 +115,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
115115
116116 IO ::writeln ("<href= {$ deployment ['url ' ]}> " . Styles::gray ($ deployment ['url ' ]) . '</> ' );
117117
118- if ($ config ['type ' ] === 'serverless-framework ' ) {
118+ $ isServerlessFrameworkDeploy = $ config ['type ' ] === 'serverless-framework ' ;
119+
120+ if ($ isServerlessFrameworkDeploy ) {
119121 if ($ credentials === null ) {
120122 IO ::spinError ();
121123 throw new Exception ('Internal error: Bref Cloud did not provide AWS credentials, it should have in its response. Please report this issue. ' );
@@ -146,10 +148,20 @@ protected function execute(InputInterface $input, OutputInterface $output): int
146148 }
147149
148150 $ startTime = time ();
151+ $ deployLogs = [];
149152
150153 // Timeout after 15 minutes
151154 while (time () - $ startTime < 15 * 60 ) {
152155 $ deployment = $ brefCloud ->getDeployment ($ deploymentId );
156+
157+ // Logs
158+ if (! $ isServerlessFrameworkDeploy ) {
159+ // Diff between all the deployment logs and the ones we already know about
160+ $ newLogs = array_slice ($ deployment ['logs ' ], count ($ deployLogs ));
161+ IO ::verbose (array_map (fn ($ record ) => $ record ['line ' ], $ newLogs ));
162+ $ deployLogs = $ deployment ['logs ' ];
163+ }
164+
153165 if ($ deployment ['status ' ] === 'success ' ) {
154166 IO ::spinSuccess ($ deployment ['message ' ], $ deployment ['app_url ' ] ?? null );
155167 return 0 ;
@@ -163,6 +175,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
163175 ]);
164176 return 1 ;
165177 }
178+
166179 delay (1 );
167180 }
168181
0 commit comments