Skip to content

Instantly share code, notes, and snippets.

@pfichtner
Created December 2, 2018 10:30
Show Gist options
  • Select an option

  • Save pfichtner/ac0e220975043fd92c34cf44510842c2 to your computer and use it in GitHub Desktop.

Select an option

Save pfichtner/ac0e220975043fd92c34cf44510842c2 to your computer and use it in GitHub Desktop.
reruns all tests on each git commit and copy the results to tmp
#!/bin/sh
DIRECTORY=$1
count=1
cd $DIRECTORY && git log --date-order --reverse --grep="autocommit on change" | grep ^commit | cut -d' ' -f2 | while read TAG; do
git clean -fd && \
git reset --hard $TAG && \
rm -rf target/surefire-reports target/allure-results && \
mvn test ; \
TARGET=/tmp/target-`printf '%04d' $count`
cp -ax $DIRECTORY/target $TARGET
count=`expr $count + 1`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment