Index: build/vsquishqt.sh =================================================================== diff -u --- build/vsquishqt.sh (revision 0) +++ build/vsquishqt.sh (revision 8a850e06863b766b6f0041a0ba66ec2003adee2a) @@ -0,0 +1,95 @@ +#!/bin/bash + +# $./run.build.sh release 5.12.5 /media/sf_VMSHARE +#setup Qt dir version +if [[ "$2" = "" ]]; then + QT_VER="" +else + QT_VER=$2 +fi + +#Setting up server folder +if [[ "$3" = "" ]]; then + SERVER_DIR="/media/XDrive" +else + SERVER_DIR=$3 +fi + +# project pro file +project=VSquishQt +pro_path=validation/$project +pro_name=$project.pro + +pro_build="CONFIG+=qtquickcompiler" + +out_path="build" +REMOTE_DIR="$SERVER_DIR/Users/Bamboo-Projects/DEN_VV/$project" +REPORT_DIR="$timeStamp-BuildNo-$buildNumber-$buildPlan" + +# gcc env +gcc_qmake="/opt/Qt$QT_VER/5.12.5/gcc_64/bin/qmake" +gcc_make="/usr/bin/make" +gcc_out_base="gcc_64" +gcc_out=$gcc_out_base"_"$pro_type +gcc_spec="-spec linux-g++" + +#check if the out folders already exists +if [[ -e $out_path ]]; then + rm -frd $out_path +fi +echo " ------------------------------ create the build folder" +mkdir $out_path + +if [[ -e $pro_path ]]; then + rm -frd $pro_path +fi + +if [[ "$1" = "clean" ]]; then + exit 0 +fi + +echo " ------------------------------ clone the application repository" +git clone ssh://git@dvm-linux02:7999/vv/vsquishqt.git + +cd $out_path + +# ============================================================= +echo " ------------------------------ Start building [$gcc_out]" +mkdir -p $gcc_out +cd $gcc_out + +echo " ------------------------------ run qmake" +$gcc_qmake ../../$pro_path/$pro_name $gcc_spec $pro_build + +echo " ------------------------------ run make" +build_err=../build_$gcc_out.err +build_log=../build_$gcc_out.log +$gcc_make -j4 1> $build_log 2> $build_err + +if [[ $(grep "error:" $build_err) != "" ]]; then + echo "ERROR: Application Build Failed [$gcc_out]" + exit 2 +fi + +if [[ $(grep "warning:" $build_err) != "" ]]; then + echo "WARNING: Application Build Has Warnings [$gcc_out]" + #exit 3 +fi +cd .. + +#return back to out path +cd .. + +#return back to main folder +cd .. + +echo " ------------------------------ copy the out file into the server" +LOG=Logs + +echo " ------------------------------ $gcc_out" +mkdir -p $REMOTE_DIR/$REPORT_DIR/$LOG +cp $out_path/* $REMOTE_DIR/$REPORT_DIR/$LOG +mkdir -p $REMOTE_DIR/$REPORT_DIR/bin/$gcc_out +cp $out_path/$gcc_out/denali $REMOTE_DIR/$REPORT_DIR/bin/$gcc_out +sync;sync;sync; +