1 #!/bin/bash
3 echo "Edma3lld release Build!!"
4 start_time=`date +%s`
5 export PATH=$PATH:/bin
6 date=`date '+%b_%d_%Y_%I_%M_%p'`
7 date_print=`date '+%d-%b-%Y %I:%M:%S %p'`
8 month=`date '+%b_%Y'`
9 year=`date '+%Y'`
11 # Get user input
12 edma_tag=$1
13 if [ "$edma_tag" == "" ]; then
14 edma_tag="j6_master"
15 fi
16 working_dir=$2
17 if [ "$working_dir" == "" ]; then
18 working_dir="/data/datalocal1_videoapps01/user/pdp_jenkin_build/edma_daily_build"
19 fi
20 edma_clone_dir=$3
21 if [ "$edma_clone_dir" == "" ]; then
22 edma_clone_dir="edma3_lld"
23 fi
24 rel_label=$4
25 version=$5
27 # Present working directory from where the script runs
28 cd $working_dir
30 output_dir=$working_dir"/logs/"$year"/"$month"/"$date
32 edma_tar_log=$output_dir"/"$edma_clone_dir"_tar.log"
34 echo "Date : "$date_print
35 echo "Build Log @ : "$output_dir
36 echo ""
38 # Remove any old directory
39 rm -rf $output_dir
41 # Make directory based on date
42 mkdir -p $working_dir/logs
43 mkdir -p $working_dir/logs/$year/$month
44 mkdir -p $output_dir
46 # Get the edma build script and start the build.
47 cd $working_dir
48 git archive --remote=ssh://git@bitbucket.itg.ti.com/processor-sdk/edma3_lld.git $edma3_lld_tag edma3_lld_build.sh > temp.tar
49 tar -xf temp.tar --strip-components 0
50 rm -rf temp.tar
51 chmod 777 edma3_lld_build.sh
53 bash ./edma3_lld_build.sh "$edma_tag" "$working_dir" "$edma_clone_dir" "false" "false" "$output_dir"
55 #remove the files which should not be part of the package
56 cd $working_dir/$edma_clone_dir
57 echo "deleting scripts which should not be part of release package"
58 rm -f edma3_lld_build.sh
59 rm -f edma3_lld_kw_build.sh
60 rm -f edma3_lld_release_build.sh
61 rm -f edma3_lld_release.bat
62 rm -rf .git
63 rm -f .gitignore
65 #delete the obj files
66 echo "deleting created obj files"
67 rm -rf `find ./packages/ti/sdo/edma3/ -name obj`
68 #copy the webgen folder to $working_dir to call the webgen publish and delete from package.
69 rm -rf $working_dir/webgen
70 cp -rf $working_dir/$edma_clone_dir/webgen $working_dir/
71 rm -rf $working_dir/$edma_clone_dir/webgen
73 #remove the doc files
74 echo "deleting all doc files"
75 cd $working_dir/$edma_clone_dir
76 rm -f ./makerules/docs/*.doc
77 rm -f ./docs/*.doc
78 rm -f ./packages/ti/sdo/edma3/drv/docs/*.doc
79 rm -f ./packages/ti/sdo/edma3/rm/docs/*.doc
80 rm -f software-manifest.doc
82 #make the tar file
83 echo "creating tar file for the release"
84 # remove the tar file and tar.gz file if it already exists
85 cd $working_dir
86 rm -f $edma_clone_dir.tar
87 rm -f $edma_clone_dir.tar.gz
88 tar -cvf $edma_clone_dir.tar $edma_clone_dir 1>$edma_tar_log
89 gzip $edma_clone_dir.tar
91 #update the release version in webgen makefile
92 cd $working_dir
93 sed -i -e "s|02.11.06.01|$version|g" $working_dir/webgen/makefile
95 #copy the files to release location
96 echo "copying files to release location"
97 cd $working_dir
98 rel_location="/data/PSP/Releases/ODC/EDMA3/"$rel_label
99 echo $rel_location
101 rm -rf $rel_location
102 mkdir -p $rel_location
103 cp $edma_clone_dir.tar.gz $rel_location
104 cp $working_dir/webgen/makefile $rel_location
106 cd $working_dir/$edma_clone_dir
107 cp -rf --parent docs/ $rel_location
108 cp -rf --parent examples/CSL2_DAT_DEMO/docs/ $rel_location
109 cp -rf --parent makerules/docs/ $rel_location
110 cp -rf --parent packages/ti/sdo/edma3/drv/docs/ $rel_location
111 cp -rf --parent packages/ti/sdo/edma3/rm/docs/ $rel_location
112 cp release_notes_edma3_lld.html $rel_location
113 cp software-manifest.pdf $rel_location
115 rm -rf $working_dir/webgen
117 end_time=`date +%s`
118 let deltatime=end_time-start_time
119 let hours=deltatime/3600
120 let minutes=deltatime/60
121 let minutes=minutes%60
122 let seconds=deltatime%60
123 printf "Execution Time: %d:%02d:%02d\n" $hours $minutes $seconds
125 exit