Last active
November 15, 2019 17:39
-
-
Save akash1810/c681d57155f8e48e95214ca39a8f8cdf to your computer and use it in GitHub Desktop.
Compare images between two Grid environments
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 | |
set -e | |
# Compare images between two Grid environments | |
# Assumes: | |
# - grid-cli installed `brew install guardian/devtools/grid-cli` | |
# - `test` and `prod` profiles configured `grid configuration:add` | |
# How it works: | |
# - Download image from PROD | |
# - Upload image to TEST | |
# - Compare media-api responses | |
IMAGE_ID=$1 | |
echo '⏬ Downloading image from PROD️' | |
grid image:download ${IMAGE_ID} -d . -p prod | |
echo '⏫ Uploading image to TEST' | |
grid image:upload ${IMAGE_ID} -p test | |
echo '💾 Saving PROD api response' | |
grid image:get ${IMAGE_ID} -p prod > prod.json | |
echo '💾 Saving TEST api response' | |
grid image:get ${IMAGE_ID} -p test > test.json | |
echo 'Comparing...' | |
npx json-diff prod.json test.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment