Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
md5 hash secrets to detect when to bounce apps
#!/bin/bash
oc get secrets | md5sum > /tmp/secrets.md5
#!/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
You can’t perform that action at this time.