aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/lib/sdnc
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/vagrant-onap/lib/sdnc')
-rwxr-xr-xbootstrap/vagrant-onap/lib/sdnc74
1 files changed, 58 insertions, 16 deletions
diff --git a/bootstrap/vagrant-onap/lib/sdnc b/bootstrap/vagrant-onap/lib/sdnc
index b3c64f90e..6765f1444 100755
--- a/bootstrap/vagrant-onap/lib/sdnc
+++ b/bootstrap/vagrant-onap/lib/sdnc
@@ -2,31 +2,67 @@
set -o xtrace
-# build_sdnc_images() - Builds SDNC images from source code
-function build_sdnc_images {
- local src_folder=/opt/sdnc/oam
- clone_repo sdnc/oam $src_folder
- build_docker_image $src_folder/installation/ubuntu
+source /var/onap/functions
+source /var/onap/asserts
+
+src_folder=$git_src_folder/openecomp/sdnc
+sdnc_repos=("core" "adaptors" "northbound" "plugins" "oam")
+
+# clone_all_sdnc_repos() - Function that clones SDNC source repo.
+function clone_all_sdnc_repos {
+ for dirc in ${sdnc_repos[@]}; do
+ clone_repo sdnc/$dirc $src_folder/$dirc
+ done
+}
+
+# compile_all_sdnc_repos() - Function that compiles SDNC source repo.
+function compile_all_sdnc_repos {
+ for dirc in ${sdnc_repos[@]}; do
+ if [[ "$dirc" == "core" ]]; then
+ compile_src $src_folder/core/rootpom
+ fi
+ compile_src $src_folder/$dirc
+ done
+}
+
+# _build_sdnc_images() - Builds SDNC images from source code
+function _build_sdnc_images {
+ local folder=$1
+
+ build_docker_image $folder/installation/ubuntu
+ asserts_image openecomp/ubuntu-sdnc-image
+
/var/lib/dpkg/info/ca-certificates-java.postinst configure
- build_docker_image $src_folder/installation/sdnc
- build_docker_image $src_folder/installation/admportal
- build_docker_image $src_folder/installation/dgbuilder
+ build_docker_image $folder/installation/sdnc
+ asserts_image openecomp/sdnc-image
+
+ build_docker_image $folder/installation/admportal
+ asserts_image openecomp/admportal-sdnc-image
+
+ build_docker_image $folder/installation/dgbuilder
+ asserts_image openecomp/dgbuilder-sdnc-image
}
-# install_sdnc() - Download and install SDNC services from source code
-function install_sdnc {
- install_package unzip
- local src_folder=/opt/sdnc/oam
- export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
- clone_repo sdnc/oam $src_folder
+# get_sdnc_images() - Build or retrieve necessary images
+function get_sdnc_images {
if [[ "$build_image" == "True" ]]; then
- build_sdnc_images
+ # The OAM code depends on all the SDNC repos which should be downloaded and compiled first
+ if [[ "$compile_repo" == "False" ]]; then
+ compile_all_sdnc_repos
+ fi
+ _build_sdnc_images $src_folder/oam
else
pull_openecomp_image sdnc-image openecomp/sdnc-image:latest
pull_openecomp_image admportal-sdnc-image openecomp/admportal-sdnc-image:latest
pull_openecomp_image dgbuilder-sdnc-image openecomp/dgbuilder-sdnc-image:latest
fi
- pushd $src_folder/installation/src/main/yaml
+}
+
+# install_sdnc() - Download and install SDNC services from source code
+function install_sdnc {
+ install_package unzip
+ clone_repo sdnc/oam $src_folder/oam
+ pushd $src_folder/oam/installation/src/main/yaml
install_docker_compose
/opt/docker/docker-compose up -d
popd
@@ -34,5 +70,11 @@ function install_sdnc {
# init_sdnc() - Function that initialize SDNC services
function init_sdnc {
+ start_ODL
+ clone_all_sdnc_repos
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_all_sdnc_repos
+ fi
+ get_sdnc_images
install_sdnc
}