shell 脚本执行dailybuild
来源:互联网 发布:网络培训管理系统 编辑:程序博客网 时间:2024/06/06 20:55
#!/bin/bash
DestMailsList=("xxx@xxx.com");
BUILD_DIR=g3_asic_yocto
LOG_FILE="g3_asic_dailybuild.txt"
TAIL_FILE="./tail.txt"
#CurTime=$(date "+%Y%m%d")
DayTimeTag=$(date "+%Y%m%d")
MonTimeTag=$(date "+%Y%m")
YestTag=$(date -d '3 days ago' +%Y%m%d)
WORK_DIR=/space/pchen/g3_yocto_build/
cd $WORK_DIR
CurDIR=$(pwd)
if [ -d $MonTimeTag ]; then
echo "Have created dir $MonTimeTag"
else
mkdir $MonTimeTag
fi
mkdir $MonTimeTag/$DayTimeTag
#Gitclone Source Codes of Titan.
if [ -d $BUILD_DIR-$YestTag ]; then
echo "The Source Codes had git cloned before should be removed first."
rm $BUILD_DIR-$YestTag -rf
else
echo "The First time to Git clone the Source Code and build. "
fi
git clone -b g3-krogoth-master gitolite@cs-local-gitmirror:sw/platforms/cs-unified/distro/yocto $BUILD_DIR-$DayTimeTag
cd $BUILD_DIR-$DayTimeTag
git clone -b g3-krogoth-master gitolite@cs-local-gitmirror:sw/platforms/cs-unified/distro/openembedded/meta-openembedded
git clone -b g3-krogoth-master gitolite@cs-local-gitmirror:sw/platforms/cs-unified/distro/meta-oe-yocto-cortina
git clone -b g3-krogoth-master gitolite@cs-local-gitmirror:sw/platforms/cs-unified/distro/meta-ca-bsp
export TEMPLATECONF=meta-ca-bsp/conf/g3-eng/
#pwd
#ls
source ./oe-init-build-env
#Make build
bitbake basic-image > $CurDIR/$LOG_FILE
#Copy the output image
cd $CurDIR
#echo $CurDIR
#echo $CurTime
#if [ -d $CurTime ]; then
# echo "remove the first."
# rm $CurTime -rf
# mkdir $CurTime
#else
# echo "12233"
# mkdir $CurTime
#fi
cp $BUILD_DIR-$DayTimeTag/build/tmp/deploy/images/g3-eng/Image $MonTimeTag/$DayTimeTag
cp $BUILD_DIR-$DayTimeTag/build/tmp/deploy/images/g3-eng/Image-ca7774-engboard.dtb $MonTimeTag/$DayTimeTag
cp $BUILD_DIR-$DayTimeTag/build/tmp/deploy/images/g3-eng/basic-image-g3-eng.cpio.xz $MonTimeTag/$DayTimeTag
cp $BUILD_DIR-$DayTimeTag/build/tmp/deploy/images/g3-eng/u-boot.bin $MonTimeTag/$DayTimeTag
cp $LOG_FILE $MonTimeTag/$DayTimeTag/$DayTimeTag-$LOG_FILE
tail -10 $LOG_FILE > $TAIL_FILE
grep -I "Error" $TAIL_FILE
if [ $? -eq 0 ]; then
echo "The daily compile building had failed. --- Please refer the attchment log file!" > $TAIL_FILE
else
echo "The daily compile building had PASSED successful. --- OK!" > $TAIL_FILE
fi
echo "#######################################################" >> $TAIL_FILE
echo "" >> $TAIL_FILE
echo "... ... ..." >> $TAIL_FILE
echo "" >> $TAIL_FILE
tail -20 $LOG_FILE >> $TAIL_FILE
#Restart the Mail Services
#service postfix restart
#service sendmail restart
#Send Emails
for m in ${DestMailsList[@]}; do
echo $m
cat $TAIL_FILE | mutt -s "G3 ASIC YOCTO Daily Build - "$DayTimeTag $m -a $LOG_FILE
done
#End
DestMailsList=("xxx@xxx.com");
BUILD_DIR=g3_asic_yocto
LOG_FILE="g3_asic_dailybuild.txt"
TAIL_FILE="./tail.txt"
#CurTime=$(date "+%Y%m%d")
DayTimeTag=$(date "+%Y%m%d")
MonTimeTag=$(date "+%Y%m")
YestTag=$(date -d '3 days ago' +%Y%m%d)
WORK_DIR=/space/pchen/g3_yocto_build/
cd $WORK_DIR
CurDIR=$(pwd)
if [ -d $MonTimeTag ]; then
echo "Have created dir $MonTimeTag"
else
mkdir $MonTimeTag
fi
mkdir $MonTimeTag/$DayTimeTag
#Gitclone Source Codes of Titan.
if [ -d $BUILD_DIR-$YestTag ]; then
echo "The Source Codes had git cloned before should be removed first."
rm $BUILD_DIR-$YestTag -rf
else
echo "The First time to Git clone the Source Code and build. "
fi
git clone -b g3-krogoth-master gitolite@cs-local-gitmirror:sw/platforms/cs-unified/distro/yocto $BUILD_DIR-$DayTimeTag
cd $BUILD_DIR-$DayTimeTag
git clone -b g3-krogoth-master gitolite@cs-local-gitmirror:sw/platforms/cs-unified/distro/openembedded/meta-openembedded
git clone -b g3-krogoth-master gitolite@cs-local-gitmirror:sw/platforms/cs-unified/distro/meta-oe-yocto-cortina
git clone -b g3-krogoth-master gitolite@cs-local-gitmirror:sw/platforms/cs-unified/distro/meta-ca-bsp
export TEMPLATECONF=meta-ca-bsp/conf/g3-eng/
#pwd
#ls
source ./oe-init-build-env
#Make build
bitbake basic-image > $CurDIR/$LOG_FILE
#Copy the output image
cd $CurDIR
#echo $CurDIR
#echo $CurTime
#if [ -d $CurTime ]; then
# echo "remove the first."
# rm $CurTime -rf
# mkdir $CurTime
#else
# echo "12233"
# mkdir $CurTime
#fi
cp $BUILD_DIR-$DayTimeTag/build/tmp/deploy/images/g3-eng/Image $MonTimeTag/$DayTimeTag
cp $BUILD_DIR-$DayTimeTag/build/tmp/deploy/images/g3-eng/Image-ca7774-engboard.dtb $MonTimeTag/$DayTimeTag
cp $BUILD_DIR-$DayTimeTag/build/tmp/deploy/images/g3-eng/basic-image-g3-eng.cpio.xz $MonTimeTag/$DayTimeTag
cp $BUILD_DIR-$DayTimeTag/build/tmp/deploy/images/g3-eng/u-boot.bin $MonTimeTag/$DayTimeTag
cp $LOG_FILE $MonTimeTag/$DayTimeTag/$DayTimeTag-$LOG_FILE
tail -10 $LOG_FILE > $TAIL_FILE
grep -I "Error" $TAIL_FILE
if [ $? -eq 0 ]; then
echo "The daily compile building had failed. --- Please refer the attchment log file!" > $TAIL_FILE
else
echo "The daily compile building had PASSED successful. --- OK!" > $TAIL_FILE
fi
echo "#######################################################" >> $TAIL_FILE
echo "" >> $TAIL_FILE
echo "... ... ..." >> $TAIL_FILE
echo "" >> $TAIL_FILE
tail -20 $LOG_FILE >> $TAIL_FILE
#Restart the Mail Services
#service postfix restart
#service sendmail restart
#Send Emails
for m in ${DestMailsList[@]}; do
echo $m
cat $TAIL_FILE | mutt -s "G3 ASIC YOCTO Daily Build - "$DayTimeTag $m -a $LOG_FILE
done
#End
0 0
- shell 脚本执行dailybuild
- php执行shell脚本
- 如何执行shell脚本
- shell脚本执行顺序
- Android 执行shell脚本
- android执行shell脚本
- Hadoop执行shell脚本
- Android执行shell脚本
- Android shell 脚本执行
- shell执行脚本
- Android执行shell脚本
- 如何执行shell脚本
- PHP执行shell脚本
- Android执行shell脚本
- ANT 执行SHELL脚本
- ios 执行shell脚本
- 后台执行shell脚本
- shell 脚本执行命令
- c++作业3
- Codeforces 287(div2)
- 解决Unity3D本地帮助文档打开速度慢的问题
- Linux和Windows域名解析
- 如何找到Web项目编译好的class文件
- shell 脚本执行dailybuild
- Linux上安装Redis(Ubuntu16.04+Redis3.2.8)最烦网上流传的那些根本走不通的教程
- 欢迎使用CSDN-markdown编辑器
- sqlalchemy中文问题解决方案
- Android 获取 View 宽高的常用正确方式,避免为零
- [jzoj]3499. 【NOIP2013模拟联考15】人类基因组(genes) (单调队列、前缀和、线段树解一题)
- html和native使用JSBridge交互
- 清除域名缓存
- Tomcat多域名配置