#!/bin/bash
echo "cd $JENKINS_HOME/jobs/$JOB_BASE_NAME/builds/${BUILD_NUMBER}"
cd $JENKINS_HOME/jobs/$JOB_BASE_NAME/builds/${BUILD_NUMBER}
echo ---
grep -B 1 "Got error: [0-9]\{4\}:" log
if [ $? = 0 ];then
	echo ---
	exit -1
fi

grep -B 1 "ERROR [0-9]\{4\} " log
if [ $? = 0 ];then
	echo ---
	exit -1
fi

grep -B 3 "show tables failed" log
if [ $? = 0 ];then
	echo ---
	exit -1
fi

grep -B 1 "EXEC_SQL_FAIELD Error 1813" log
if [ $? = 0 ];then
	echo ---
	exit -1
fi
echo "post_build_script_sync_db finish~"
