-
-
Save dgageot/664291 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
#!/bin/bash | |
#run ./build.sh on another terminal window | |
#it will clone your existing repo and run the maven tests off this clone | |
#the branch tests are run from is the current branch | |
# | |
# ./build.sh | |
#the cloned repo will live in ../DIRECTORY_ROOT/REPO_DIRECTORY | |
DIRECTORY_ROOT="../privatebuild/" | |
#get the lastest part of the directory name | |
IFS="/" | |
SPLIT_DIR=(`pwd`) | |
SIZE=${#SPLIT_DIR[@]} | |
let LAST_INDEX=$SIZE-1 | |
DIRECTORY_SUFFIX=${SPLIT_DIR[$LAST_INDEX]} | |
IFS="" | |
DIRECTORY="${DIRECTORY_ROOT}${DIRECTORY_SUFFIX}" | |
BRANCH=`git branch | grep "*" | awk '{print $NF}'` | |
#fresh clone | |
rm -Rf $DIRECTORY | |
git clone -slb "$BRANCH" . $DIRECTORY | |
cd $DIRECTORY | |
echo "" | |
echo "***** Working on branch $BRANCH *****" | |
echo "" | |
if [ -e "pom.xml" ]; then | |
mvn clean install | |
if [ $? -eq 0 ]; then | |
echo "Build results" | |
# git push $REMOTE_REPO master | |
else | |
echo "Unable to build" | |
exit $? | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment