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

adding script to auto restart task #6072

Merged

Conversation

pvisweswar
Copy link
Contributor

@pvisweswar pvisweswar commented Aug 1, 2023

Ticket : https://dimagi-dev.atlassian.net/browse/SAAS-14342

Environments Affected : Staging

@dannyroberts dannyroberts marked this pull request as ready for review September 12, 2023 13:35
@@ -0,0 +1,23 @@
#!/bin/bash

current_availability_zone=$(ec2metadata --availability-zone | awk -F'-' '{print $3}')
Copy link
Member

Choose a reason for hiding this comment

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

This would be more general if you pull of just a instead of 1a, because the 1 is part of the region

Copy link
Contributor Author

@pvisweswar pvisweswar Sep 13, 2023

Choose a reason for hiding this comment

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

modified the command as suggested above ec2metadata --availability-zone | awk -F'-' '{print $3}' | cut -c2-
It uses cut to remove the character from the output -c, --characters=LIST select only these characters. In our case it pulling of just a from 1a.

@dannyroberts
Copy link
Member

I just noticed, this should say Staging not production

Environments Affected : Production

in the description. This should not affect production. My approval is assuming that this will only affect staging

@pvisweswar
Copy link
Contributor Author

I just noticed, this should say Staging not production

Environments Affected : Production

in the description. This should not affect production. My approval is assuming that this will only affect staging

Danny, you are correct; I set the environment to staging

Copy link
Contributor

@AmitPhulera AmitPhulera left a comment

Choose a reason for hiding this comment

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

Went through the dry-run of the command on staging. It looked good. Approved to apply the changes on staging.

@AmitPhulera AmitPhulera merged commit 2442249 into dimagi:master Jan 31, 2024
2 checks passed
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.

3 participants