aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/lib/functions
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2017-12-08 11:57:42 -0800
committerVictor Morales <victor.morales@intel.com>2017-12-08 11:57:42 -0800
commit5464664702bc07c180ed82eb1a5d9bcc9e5d18ec (patch)
treec45bae722f80a3481965fec72385ad137c36ea6b /bootstrap/vagrant-onap/lib/functions
parent5d21f64981e69f6a266da1ec30754de5d8d71e26 (diff)
Centralize src_folder and repos info
The configuration values that determines where the source code will be cloned and the list of repos associated to specific project have been included in a new global configuration file, which pretends to facilitate their changes. Change-Id: I700bfe02e6b2f8bf8eef763e44b5e037357ec892 Signed-off-by: Victor Morales <victor.morales@intel.com> Issue-ID: INT-367
Diffstat (limited to 'bootstrap/vagrant-onap/lib/functions')
-rwxr-xr-xbootstrap/vagrant-onap/lib/functions18
1 files changed, 5 insertions, 13 deletions
diff --git a/bootstrap/vagrant-onap/lib/functions b/bootstrap/vagrant-onap/lib/functions
index 8d906dc68..08c6d916b 100755
--- a/bootstrap/vagrant-onap/lib/functions
+++ b/bootstrap/vagrant-onap/lib/functions
@@ -1,6 +1,7 @@
#!/bin/bash
source /var/onap/commons
+source /var/onap/config/env-vars
source /var/onap/_composed_functions
source /var/onap/_onap_functions
@@ -9,7 +10,6 @@ export NIC=$(ip route get 8.8.8.8 | awk '{ print $5; exit }')
export IP_ADDRESS=$(ifconfig $NIC | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
mvn_conf_file=/root/.m2/settings.xml
-git_src_folder=/opt
# configure_dns() - DNS/GW IP address configuration
function configure_dns {
@@ -71,13 +71,9 @@ function clone_repo {
function clone_repos {
local project=$1
local repo_name=${2:-$project}
- local name=${project}_repos[@]
- local src_name=${project}_src_folder
- local repos_list=("${!name}")
- local dest_folder=${!src_name}
- for repo in ${repos_list[@]}; do
- clone_repo $repo $dest_folder${repo#*$repo_name}
+ for repo in ${repos[$project]}; do
+ clone_repo $repo ${src_folders[$project]}${repo#*$repo_name}
done
}
@@ -305,13 +301,9 @@ function compile_src {
# 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}
+ for repo in ${repos[$project]}; do
+ compile_src ${src_folders[$project]}${repo#*$project}
done
}