3 # Common parameter parsing for kvmfornfv scripts
7 echo "Usage --> $0 [-p package_type] [-o output_dir] [-h]"
8 echo " package_type : centos/ubuntu/both ; default is centos"
9 echo " output_dir : stores rpm and debian packages"
10 echo " -h : Help section"
17 function build_package() {
22 echo "Build $choice Rpms"
28 echo "Build $choice Debians"
34 echo "Build $choice Debians and Rpms"
42 echo "Invalid package option"
49 ## --- Parse command line arguments / parameters ---
50 while getopts ":o:p:h" option; do
59 echo "Option -$OPTARG requires an argument."
68 echo "Unknown option: $OPTARG."
73 echo "[WARNING] Unknown parameters!!!"
74 echo "Using default values for package generation & output"
83 if [[ -z "$output_dir" ]]
85 output_dir=$WORKSPACE/build_output
89 echo "Building for $type package in $output_dir"