Created
March 2, 2016 14:22
-
-
Save tonygaetani/6e4868639db12fe1bf8c to your computer and use it in GitHub Desktop.
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 -euo pipefail | |
IFS=$'\n\t' | |
HEAD=$(git rev-parse --abbrev-ref HEAD) | |
if [[ "${HEAD}" == "HEAD" ]]; then | |
HEAD=$(git rev-parse HEAD) | |
fi | |
STASH=0 | |
if [[ -n $(git status --porcelain) ]]; then | |
git stash | |
STASH=1 | |
fi | |
trap "git checkout ${HEAD} && test ${STASH} -ne 1 || git stash pop" EXIT | |
readonly COMMITS=$(git log --pretty=oneline "${START}...${END}"| cut -d' ' -f1| tail -r) | |
for commit in ${COMMITS[@]}; do | |
git checkout $commit | |
./gradlew build -x test > "build${commit}" 2>&1 | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment