3 # Common parameter parsing for kvmfornfv scripts
8 echo "Usage --> $0 [-p package_type] [-o output_dir] [-h]"
9 echo " package_type : centos/ubuntu/both ; default is ubuntu"
10 echo " output_dir : stores rpm and debian packages"
11 echo " -h : Help section"
21 cd $WORKSPACE/ci/build_rpm
22 sudo docker build -t stor_rpm .
23 sudo docker run --privileged=true -v $WORKSPACE:/opt/stor4nfv -t stor_rpm \
24 /opt/stor4nfv/ci/build_interface.sh $1
27 cd $WORKSPACE/ci/build_deb
28 sudo docker build -t stor_deb .
29 sudo docker run -v $WORKSPACE:/opt/stor4nfv -t stor_deb \
30 /opt/stor4nfv/ci/build_interface.sh $1
32 *) echo "Not supported system"; exit 1;;
36 function build_package() {
40 echo "Build $choice Rpms/Debians"
44 echo "Build $choice Debians and Rpms"
49 echo "Invalid package option"
56 ## --- Parse command line arguments / parameters ---
57 while getopts ":o:p:h" option; do
66 echo "Option -$OPTARG requires an argument."
75 echo "Unknown option: $OPTARG."
80 echo "[WARNING] Unknown parameters!!!"
81 echo "Using default values for package generation & output"
90 if [[ -z "$output_dir" ]]
92 output_dir=$WORKSPACE/build_output
95 job_type=`echo $JOB_NAME | cut -d '-' -f 2`
98 echo "Building for $type package in $output_dir"
104 if [ $job_type == "verify" ]; then
105 if [ $type == "centos" ]; then
106 #echo "Removing kernel-debuginfo rpm from output_dir"
107 #rm -f ${output_dir}/kernel-debug*
108 echo "Checking packages in output_dir"
109 ls -lrth ${output_dir}
111 echo "Removing debug debian from output_dir"
112 rm -f ${output_dir}/*dbg*
113 echo "Checking packages in output_dir"
114 ls -lrth ${output_dir}