Created
April 12, 2019 19:52
-
-
Save simbo1905/4562926d3d370b171b05364ed985612d to your computer and use it in GitHub Desktop.
md5 hash secrets to detect when to bounce apps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
oc get secrets | md5sum > /tmp/secrets.md5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SECRETS_MD5_OLD=$(</tmp/secrets.md5) | |
SECRETS_MD5_NEW=$(oc get secrets | md5sum) | |
if [ "$SECRETS_MD5_NEW" != "$SECRETS_MD5_OLD" ]; then | |
echo "secrets have changed. bouncing apps." | |
oc rollout latest dc/appone -n env-demo-staging | |
oc rollout latest dc/apptwo -n env-demo-staging | |
oc rollout latest dc/appthree -n env-demo-staging | |
else | |
echo "secrets have NOT changed." | |
fi | |
cowsay "Secrets all done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment