Latest changes by vics and working ftp upload

This commit is contained in:
Pavol Zibrita 2011-04-18 10:18:53 +02:00
parent 66634c0c8b
commit 9277d012d7
5 changed files with 36 additions and 25 deletions

View file

@ -18,10 +18,19 @@ do
ch=$(expr index "$i" ">") ch=$(expr index "$i" ">")
if [ $ch = 0 ]; then if [ $ch = 0 ]; then
BRANCH=${i#"$GIT_ORIGIN_NAME/"} 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" echo "Checkouting branch and create build for $BRANCH"
## reset all previous changes in working tree ## reset all previous changes in working tree
git checkout . git checkout .
git reset HEAD --hard
git checkout $BRANCH git checkout $BRANCH
git merge $GIT_ORIGIN_NAME/$BRANCH
sed -e "s/\(APP_DESCRIPTION.*=.*\"\).*\(\".*\)/\1$DATE $BRANCH\2/g" $VERSION_FILE > ${VERSION_FILE}.bak sed -e "s/\(APP_DESCRIPTION.*=.*\"\).*\(\".*\)/\1$DATE $BRANCH\2/g" $VERSION_FILE > ${VERSION_FILE}.bak
mv ${VERSION_FILE}.bak ${VERSION_FILE} mv ${VERSION_FILE}.bak ${VERSION_FILE}
@ -41,4 +50,5 @@ do
ant clean debug ant clean debug
mv bin/OsmAnd-debug.apk "$BUILD_DIR/OsmAnd-$BRANCH-nb-$DATE.apk" mv bin/OsmAnd-debug.apk "$BUILD_DIR/OsmAnd-$BRANCH-nb-$DATE.apk"
fi fi
fi
done done

View file

@ -23,8 +23,7 @@ touch $LOG_FILE
"${DIRECTORY}/build_branches.sh" 2>&1 >>$LOG_FILE "${DIRECTORY}/build_branches.sh" 2>&1 >>$LOG_FILE
# 3. upload to ftp server # 3. upload to ftp server
# TODO test and uncomment "${DIRECTORY}/upload_ftp.sh" 2>&1 >>$LOG_FILE
#"${DIRECTORY}/upload_ftp.sh" 2>&1 >>$LOG_FILE
# 4. Synchronize github with googlecode mercurial # 4. Synchronize github with googlecode mercurial
"${DIRECTORY}/sync_git_hg.sh" 2>&1 >>$LOG_FILE "${DIRECTORY}/sync_git_hg.sh" 2>&1 >>$LOG_FILE

0
build-scripts/sync_git_hg.sh Normal file → Executable file
View file

4
build-scripts/update_git.sh Normal file → Executable file
View file

@ -5,6 +5,7 @@ GIT_DIR="$DIRECTORY"/osmand-git
GIT_URL=git://github.com/osmandapp/Osmand.git GIT_URL=git://github.com/osmandapp/Osmand.git
GIT_ORIGIN_NAME=origin GIT_ORIGIN_NAME=origin
#rm -rf "${GIT_DIR}"
# initialize git if it is not present (clone it) # initialize git if it is not present (clone it)
if [ ! -d "$GIT_DIR" ]; then if [ ! -d "$GIT_DIR" ]; then
git clone ${GIT_URL} "${GIT_DIR}" git clone ${GIT_URL} "${GIT_DIR}"
@ -13,5 +14,4 @@ fi
cd "${GIT_DIR}" cd "${GIT_DIR}"
git reset --hard git reset --hard
git checkout master git checkout master
git pull ${GIT_ORIGIN_NAME} git fetch ${GIT_ORIGIN_NAME}

4
build-scripts/upload_ftp.sh Normal file → Executable file
View file

@ -3,13 +3,15 @@ DIRECTORY=$(cd `dirname $0` && pwd)
FTP_SITE=download.osmand.net FTP_SITE=download.osmand.net
FTP_FOLDER=night-builds FTP_FOLDER=night-builds
FTP_LATEST=latest-night-build
# FTP_USER in local.properties # FTP_USER in local.properties
# FTP_PWD= in local.properties # FTP_PWD= in local.properties
BUILD_DIR="$DIRECTORY"/builds BUILD_DIR="$DIRECTORY"/builds
LATEST_DIR="$DIRECTORY"/latests
. "$DIRECTORY"/local.properties . "$DIRECTORY"/local.properties
# 3. upload to ftp server # 3. upload to ftp server
lftp -c "set net:timeout 45;open -u $FTP_USER,$FTP_PWD $FTP_SITE;ls $FTP_FOLDER;mirror -R $BUILD_DIR $FTP_FOLDER" lftp -c "set net:timeout 45;open -u $FTP_USER,$FTP_PWD $FTP_SITE;mirror -R $BUILD_DIR $FTP_FOLDER;mirror -R $LATEST_DIR $FTP_LATEST"
#ftp -n -v $FTP_SITE <<SCRIPT 2>&1 #ftp -n -v $FTP_SITE <<SCRIPT 2>&1
#quote USER $FTP_USER #quote USER $FTP_USER