Fix build - update scripts

This commit is contained in:
Victor Shcherb 2011-10-11 21:38:51 +02:00
parent 7d4525fede
commit 1b4b872bb8
2 changed files with 10 additions and 5 deletions

View file

@ -1,6 +1,7 @@
#!/bin/sh
DIRECTORY=$(cd `dirname $0` && pwd)
BRANCHES_CHANGED=0
GIT_DIR="$DIRECTORY"/osmand-git
GIT_ORIGIN_NAME=origin
BUILD_DIR="$DIRECTORY"/builds
@ -25,14 +26,12 @@ do
ch=$(expr index "$i" ">")
if [ $ch = 0 ]; then
BRANCH=${i#"$GIT_ORIGIN_NAME/"}
echo "Checking if there are changes : $BRANCH - $GIT_ORIGIN_NAME/$BRANCH"
git diff --exit-code "$BRANCH" "$GIT_ORIGIN_NAME/$BRANCH" --quiet
RES_DIFF=$?
if [ $RES_DIFF != 0 ]; then
echo "Checkouting branch and create build for $BRANCH"
## reset all previous changes in working tree
BRANCHES_CHANGED=1
git checkout .
git reset HEAD --hard
git checkout -f $BRANCH
@ -58,7 +57,7 @@ do
if [ ! -d assets ]; then
mkdir assets
fi
ant clean debug &> "$DIRECTORY/build.log"
ant clean debug
if [ "$BRANCH" = "release" ]; then
cp bin/OsmAnd-debug.apk "$LATESTS_DIR/OsmAnd-stable.apk"
@ -85,3 +84,5 @@ do
fi
fi
done
exit BRANCHES_CHANGED

View file

@ -11,13 +11,17 @@ mkdir -p $LOG_DIR
echo > $LOG_FILE
touch $CLOG_FILE
#git pull --rebase 2>&1 >>$LOG_FILE
git pull --rebase 2>&1 >>$LOG_FILE
# 1. Update git directory
"${DIRECTORY}/update_git.sh" >>$LOG_FILE 2>&1
# 2. Go through branches and generates builds
"${DIRECTORY}/build_branches.sh" >>$LOG_FILE 2>&1
# exit if nothing was changed
if [ $? != 0 ]; then
exit
fi
# 3. upload to ftp server
#"${DIRECTORY}/upload_ftp.sh" 2>&1 >>$LOG_FILE