Latest changes by vics and working ftp upload
This commit is contained in:
parent
66634c0c8b
commit
9277d012d7
5 changed files with 36 additions and 25 deletions
|
@ -18,27 +18,37 @@ do
|
|||
ch=$(expr index "$i" ">")
|
||||
if [ $ch = 0 ]; then
|
||||
BRANCH=${i#"$GIT_ORIGIN_NAME/"}
|
||||
echo "Checkouting branch and create build for $BRANCH"
|
||||
## reset all previous changes in working tree
|
||||
git checkout .
|
||||
git checkout $BRANCH
|
||||
sed -e "s/\(APP_DESCRIPTION.*=.*\"\).*\(\".*\)/\1$DATE $BRANCH\2/g" $VERSION_FILE > ${VERSION_FILE}.bak
|
||||
mv ${VERSION_FILE}.bak ${VERSION_FILE}
|
||||
|
||||
## build map creator
|
||||
cd ./DataExtractionOSM/
|
||||
ant clean compile build
|
||||
mv build.zip "$BUILD_DIR/OsmAndMapCreator-$BRANCH-nb-$DATE.zip"
|
||||
echo "Checking if there are changes : $BRANCH - $GIT_ORIGIN_NAME/$BRANCH"
|
||||
|
||||
## build osmand app
|
||||
cd ../OsmAnd/
|
||||
cp "$DIRECTORY"/local.properties local.properties
|
||||
rm -r bin
|
||||
mkdir bin
|
||||
if [ ! -d assets ]; then
|
||||
mkdir assets
|
||||
fi
|
||||
ant clean debug
|
||||
mv bin/OsmAnd-debug.apk "$BUILD_DIR/OsmAnd-$BRANCH-nb-$DATE.apk"
|
||||
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
|
||||
git checkout .
|
||||
git reset HEAD --hard
|
||||
git checkout $BRANCH
|
||||
git merge $GIT_ORIGIN_NAME/$BRANCH
|
||||
|
||||
sed -e "s/\(APP_DESCRIPTION.*=.*\"\).*\(\".*\)/\1$DATE $BRANCH\2/g" $VERSION_FILE > ${VERSION_FILE}.bak
|
||||
mv ${VERSION_FILE}.bak ${VERSION_FILE}
|
||||
|
||||
## build map creator
|
||||
cd ./DataExtractionOSM/
|
||||
ant clean compile build
|
||||
mv build.zip "$BUILD_DIR/OsmAndMapCreator-$BRANCH-nb-$DATE.zip"
|
||||
|
||||
## build osmand app
|
||||
cd ../OsmAnd/
|
||||
cp "$DIRECTORY"/local.properties local.properties
|
||||
rm -r bin
|
||||
mkdir bin
|
||||
if [ ! -d assets ]; then
|
||||
mkdir assets
|
||||
fi
|
||||
ant clean debug
|
||||
mv bin/OsmAnd-debug.apk "$BUILD_DIR/OsmAnd-$BRANCH-nb-$DATE.apk"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -23,8 +23,7 @@ touch $LOG_FILE
|
|||
"${DIRECTORY}/build_branches.sh" 2>&1 >>$LOG_FILE
|
||||
|
||||
# 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
|
||||
"${DIRECTORY}/sync_git_hg.sh" 2>&1 >>$LOG_FILE
|
||||
|
|
0
build-scripts/sync_git_hg.sh
Normal file → Executable file
0
build-scripts/sync_git_hg.sh
Normal file → Executable file
4
build-scripts/update_git.sh
Normal file → Executable file
4
build-scripts/update_git.sh
Normal file → Executable file
|
@ -5,6 +5,7 @@ GIT_DIR="$DIRECTORY"/osmand-git
|
|||
GIT_URL=git://github.com/osmandapp/Osmand.git
|
||||
GIT_ORIGIN_NAME=origin
|
||||
|
||||
#rm -rf "${GIT_DIR}"
|
||||
# initialize git if it is not present (clone it)
|
||||
if [ ! -d "$GIT_DIR" ]; then
|
||||
git clone ${GIT_URL} "${GIT_DIR}"
|
||||
|
@ -13,5 +14,4 @@ fi
|
|||
cd "${GIT_DIR}"
|
||||
git reset --hard
|
||||
git checkout master
|
||||
git pull ${GIT_ORIGIN_NAME}
|
||||
|
||||
git fetch ${GIT_ORIGIN_NAME}
|
||||
|
|
4
build-scripts/upload_ftp.sh
Normal file → Executable file
4
build-scripts/upload_ftp.sh
Normal file → Executable file
|
@ -3,13 +3,15 @@ DIRECTORY=$(cd `dirname $0` && pwd)
|
|||
|
||||
FTP_SITE=download.osmand.net
|
||||
FTP_FOLDER=night-builds
|
||||
FTP_LATEST=latest-night-build
|
||||
# FTP_USER in local.properties
|
||||
# FTP_PWD= in local.properties
|
||||
BUILD_DIR="$DIRECTORY"/builds
|
||||
LATEST_DIR="$DIRECTORY"/latests
|
||||
|
||||
. "$DIRECTORY"/local.properties
|
||||
# 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
|
||||
#quote USER $FTP_USER
|
||||
|
|
Loading…
Reference in a new issue