Skip to content

Instantly share code, notes, and snippets.

@IanVaughan
Last active April 26, 2023 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IanVaughan/a95d4dcd87dbe2861c2bcc3797d18f40 to your computer and use it in GitHub Desktop.
Save IanVaughan/a95d4dcd87dbe2861c2bcc3797d18f40 to your computer and use it in GitHub Desktop.
cred-diff
#!/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