2011-01-23 12:45:18 +01:00
|
|
|
#!/bin/sh
|
|
|
|
DIRECTORY=$(cd `dirname $0` && pwd)
|
|
|
|
|
|
|
|
## VARIABLES ###
|
|
|
|
LOG_DIR="$DIRECTORY"/logs
|
|
|
|
DATE=$(date +%d-%m-%y)
|
2011-10-07 01:32:52 +02:00
|
|
|
CLOG_FILE="$LOG_DIR/${DATE}.log"
|
|
|
|
LOG_FILE="$LOG_DIR/tmp.log"
|
2011-01-23 12:45:18 +01:00
|
|
|
|
2011-10-07 01:32:52 +02:00
|
|
|
mkdir -p $LOG_DIR
|
|
|
|
echo > $LOG_FILE
|
|
|
|
touch $CLOG_FILE
|
2011-01-23 12:45:18 +01:00
|
|
|
|
2011-10-07 01:32:52 +02:00
|
|
|
#git pull --rebase 2>&1 >>$LOG_FILE
|
2011-01-23 12:45:18 +01:00
|
|
|
|
|
|
|
# 1. Update git directory
|
2011-10-07 01:32:52 +02:00
|
|
|
"${DIRECTORY}/update_git.sh" >>$LOG_FILE 2>&1
|
2011-01-23 12:45:18 +01:00
|
|
|
|
|
|
|
# 2. Go through branches and generates builds
|
2011-10-07 01:32:52 +02:00
|
|
|
"${DIRECTORY}/build_branches.sh" >>$LOG_FILE 2>&1
|
2011-01-23 12:45:18 +01:00
|
|
|
|
2011-01-23 13:28:17 +01:00
|
|
|
# 3. upload to ftp server
|
2011-06-09 01:24:08 +02:00
|
|
|
#"${DIRECTORY}/upload_ftp.sh" 2>&1 >>$LOG_FILE
|
|
|
|
|
|
|
|
# 3. upload to ftp server
|
2011-10-07 01:32:52 +02:00
|
|
|
"${DIRECTORY}/copyto_dir.sh" >>$LOG_FILE 2>&1
|
2011-01-23 12:45:18 +01:00
|
|
|
|
|
|
|
# 4. Synchronize github with googlecode mercurial
|
2011-10-07 01:32:52 +02:00
|
|
|
"${DIRECTORY}/sync_git_google.sh" >>$LOG_FILE 2>&1
|
2011-01-23 12:45:18 +01:00
|
|
|
|
2011-08-29 03:13:59 +02:00
|
|
|
# 5. update site files
|
2011-10-07 01:32:52 +02:00
|
|
|
"${DIRECTORY}/update_site.sh" >>$LOG_FILE 2>&1
|
|
|
|
|
|
|
|
cat $LOG_FILE >> $CLOG_FILE
|
2011-10-10 22:09:02 +02:00
|
|
|
BUILD=`ls *.fixed *.failed 2> /dev/null | wc -l`
|
2011-10-07 01:32:52 +02:00
|
|
|
if [ ! $BUILD -eq 0 ]; then
|
2011-10-10 22:09:02 +02:00
|
|
|
# if some status change, print out complete log
|
|
|
|
echo "Builds status changed"
|
|
|
|
echo "-------------"
|
|
|
|
echo `ls *.fixed *.failed`
|
|
|
|
echo "-------------"
|
|
|
|
echo "Complete log file:"
|
2011-10-07 01:32:52 +02:00
|
|
|
echo "-------------"
|
|
|
|
cat $LOG_FILE
|
|
|
|
fi
|