Last active
April 26, 2023 15:17
-
-
Save IanVaughan/a95d4dcd87dbe2861c2bcc3797d18f40 to your computer and use it in GitHub Desktop.
cred-diff
This file contains 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
#!/usr/bin/env bash | |
# Usage | |
# cred-diff <env> (<branch|ref>|master) | |
# eg | |
# cred-diff production master | |
VAR=$2 | |
REF="${VAR:-main}" | |
git checkout $REF --quiet | |
printf . | |
rails credentials:show --environment $1 > /tmp/prod | |
printf . | |
git checkout - --quiet | |
printf . | |
rails credentials:show --environment $1 > /tmp/yours | |
echo | |
diff -C5 --label $REF /tmp/prod /tmp/yours --label "Here" | |
rm /tmp/prod /tmp/yours | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment