Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Fix exit code of down/up commands when already down/up #32200

Merged
merged 1 commit into from
Apr 2, 2020
Merged

[8.x] Fix exit code of down/up commands when already down/up #32200

merged 1 commit into from
Apr 2, 2020

Conversation

JaZo
Copy link
Contributor

@JaZo JaZo commented Apr 2, 2020

This will return exit code 0 instead of boolean true. The boolean will be cast to an int resulting in exit code 1, but if the application is already down/up exit code 0 would be desirable.

Targeted to 8.x as discussed in #32199.

Change

$ php artisan down
Application is now in maintenance mode.
$ echo $?
0
$ php artisan down
Application is already down.
$ echo $?
- 1
+ 0

$ php artisan up
Application is now live.
$ echo $?
0
$ php artisan up
Application is already up.
$ echo $?
- 1
+ 0

Context

Our deploymenttool (DeployHQ) performs php artisan down before uploading the changes, but stops if this fails. If the deployment fails later in the process - composer install or a migration might fail - our tool stops and the application is still in maintenance mode. If we fix the error and restart the deployment php artisan down now returns an exit code other than 0 and our tool thinks it failed and stops the deployment. This results in a 'locked' state where we have to manually bring the application back up before we can start a new deployment.

The boolean will be cast to an int resulting in exit code 1, but if the application is already down/up exit code 0 would be desirable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants