Skip to content

Instantly share code, notes, and snippets.

@jon-heller
Created September 20, 2017 14:46
Show Gist options
  • Save jon-heller/2c3ce3c15fe0592a4212dfbaf7c1d81d to your computer and use it in GitHub Desktop.
Save jon-heller/2c3ce3c15fe0592a4212dfbaf7c1d81d to your computer and use it in GitHub Desktop.
BackstopJS script to check out and test a branch against development
#!/bin/bash
git diff-index --quiet HEAD -- &>/dev/null
if [ $? -ne 0 ]; then
echo "Git status isn't clean! Please commit all changes first"
exit 1
fi
echo "Checking out development..."
git checkout development &>/dev/null
git pull origin development &>/dev/null
echo "Building latest development changes..."
npm run dev &>/dev/null
echo "Making Backstop reference files from development..."
echo "==================================================="
backstop reference &>/dev/null
echo "Checking out $1..."
git fetch &>/dev/null
git checkout $1 &>/dev/null
echo "Building $1..."
npm run dev &>/dev/null
echo "Testing $1..."
echo "==================================================="
backstop test &>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment