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

ci(deploy): add command & queue to put site into maintenance and brin… #1981

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

marvinroman
Copy link
Contributor

Creates a method to put the site into maintenance mode during delpoyments and creates a delayed queue that will bring the site back up within a certain amount of time (5 minutes).

  • Creates new command maintenance:queue that initiates putting the site into maintenance mode and initiating the delayed queue.
  • Creates new queue BringSiteBackUp that brings the site out of maintenance mode.
  • Added calling the command maintenance:queue at the start of the entrypoint.
  • Added running the laravel queue worker for 15 minutes after the pod starts.
  • Changed the QUEUE_CONNECTION from sync to redis this allows for delayed queues to occur.

Copy link

codecov bot commented Nov 16, 2023

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (2039e10) 96.39% compared to head (3007b06) 96.31%.

Files Patch % Lines
...p/Console/Commands/MaintenanceModeQueueCommand.php 0.00% 4 Missing ⚠️
app/Jobs/BringSiteBackUp.php 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #1981      +/-   ##
============================================
- Coverage     96.39%   96.31%   -0.09%     
- Complexity     2070     2073       +3     
============================================
  Files           312      314       +2     
  Lines          9023     9031       +8     
============================================
  Hits           8698     8698              
- Misses          325      333       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +32 to +33
// Schedule bringing the site back up after 5 minutes
BringSiteBackUp::dispatch()->delay(now()->addMinutes(5));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you mentioned in your comment on the ticket that lifecycle hooks aren't possible at the moment in your infrastructure. I'm just wondering if there really isn't a way to know when the old pod is removed and to trigger the artisan up call then. Unfortunately adding a delay doesn't adequately address the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We weren't able to come up with an alternative.

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.

During rolling deploy it is possible for the old application pod to interact with the updated database
2 participants