Detecting a failed Laravel migration in a automated script on Bamboo CD

Viewed 137

I've a deployment pipeline for as Laravel application (on Atlassian Bamboo). Unfortunately, when a migration fails during the deployment, artisan migrate doesn't return a proper exit code that would allow the deployment to be flagged as failed.

Does someone have a good solution to this problem?

Thanks.

[EDIT]

I'm on Laravel v7.17.2.

error log from bamboo on the latest of this error

build   25-Jun-2020 08:44:41    Migrating: 2020_06_17_179512_create_invoice_payment_creditor_type_qrb
build   25-Jun-2020 08:44:41    
build   25-Jun-2020 08:44:41    In 2020_06_17_179512_create_invoice_payment_creditor_type_qrb.php line 52:
build   25-Jun-2020 08:44:41                                                
build   25-Jun-2020 08:44:41      Creating default object from empty value 
1 Answers

I've made a mistake while building the deployment pipeline on Bamboo. I ran multiple commands on a single ssh task which means the return code of the migrate command (which wasn't the last command of the task) didn't fire an error. I now run each commands in a separate ssh task.

It seams obvious to me now.

Related