3 # Copyright 2016 RIFT.IO Inc
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Author(s): Austin Cormier
18 # Creation Date: 2016/05/23
21 # Generates a NSD descriptor package from a source directory
23 # gen_vnfd_pkg.sh <pkg_src_dir> <pkg_dest_dir>
28 echo "Error: Must provide 2 parameters" >@
2
35 if [ ! -e ${pkg_src_dir} ]; then
36 echo "Error: ${pkg_src_dir} does not exist"
40 if [ ! -e ${pkg_dest_dir} ]; then
41 echo "Error: ${pkg_src_dir} does not exist"
45 #echo "Generating package in directory: ${pkg_dest_dir}"
47 # Create any missing directories/files so each package has
49 vnfd_dirs
=( charms icons scripts images
)
52 vnfd_dir
="${pkg_src_dir}"
55 mkdir
-p "${pkg_dest_dir}"
56 cp -rf ${vnfd_dir}/* "${pkg_dest_dir}"
57 for sub_dir
in ${vnfd_dirs[@]}; do
58 dir_path
=${pkg_dest_dir}/${sub_dir}
62 for file in ${vnfd_files[@]}; do
63 file_path
=${pkg_dest_dir}/${file}