diff options
author | Victor Morales <victor.morales@intel.com> | 2017-11-20 16:38:28 -0800 |
---|---|---|
committer | Victor Morales <victor.morales@intel.com> | 2017-11-20 16:38:28 -0800 |
commit | f1f1ba5dac1b531c346758072c798ceb511100b3 (patch) | |
tree | a571f9e83be31abd3c63595c04a46dcd7e901a7d /bootstrap/vagrant-onap/lib/functions | |
parent | 25bfc6b99f73bd02047dcc13e64390140777402a (diff) |
Refactor clone and compile functions
The clone_all_* and compile_all_* functions share same instructions
for performing their functionality. This change pretends to reduce
the duplication of the code.
Change-Id: Ief63a5a58c79af85c829602b0451637424659438
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-Id: INT-339
Diffstat (limited to 'bootstrap/vagrant-onap/lib/functions')
-rwxr-xr-x | bootstrap/vagrant-onap/lib/functions | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bootstrap/vagrant-onap/lib/functions b/bootstrap/vagrant-onap/lib/functions index c4ed3c85f..157c910de 100755 --- a/bootstrap/vagrant-onap/lib/functions +++ b/bootstrap/vagrant-onap/lib/functions @@ -67,6 +67,19 @@ function clone_repo { fi } +# clone_repos() - Function that clones source repositories for a given project +function clone_repos { + local project=$1 + local name=${project}_repos[@] + local src_name=${project}_src_folder + local repos_list=("${!name}") + local dest_folder=${3:-${!src_name}} + + for repo in ${repos_list[@]}; do + clone_repo $repo $dest_folder${repo#*$project} + done +} + # _install_bind() - Install bind utils function _install_bind { install_packages bind9 bind9utils @@ -282,6 +295,19 @@ function compile_src { popd } +# compile_repos() - Function that compiles source repositories for a given project +function compile_repos { + local project=$1 + local name=${project}_repos[@] + local repos_list=("${!name}") + local dest_folder=${3:-$git_src_folder/$project} + + install_package unzip + for repo in ${repos_list[@]}; do + compile_src $dest_folder${repo#*$project} + done +} + # build_docker_image() - Build Docker container image from source code function build_docker_image { local src_folder=$1 |