summaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/lib/sdnc
diff options
context:
space:
mode:
authorVictor Morales <victor.morales@intel.com>2017-07-26 16:06:35 -0500
committerVictor Morales <victor.morales@intel.com>2017-07-26 16:06:35 -0500
commitdd074806ad51761392a9cca3f1f04fbbebd3de22 (patch)
tree9088768b55bf307875369e7368f56c7e66149424 /bootstrap/vagrant-onap/lib/sdnc
parent8805879b4dc92014381ba55b75955b295944ded6 (diff)
Sync latest changes for vagrant-onap
Given some internal procedures was not possible to submit all the changes. In the meantime, those changes were placed into an non-official project. This change syncronizes the latest changes into the official repository. Issue-id: INT-17 Change-Id: Ia4125f4b70273401e4ed3cc1908d2e2ad7d1c2e9 Signed-off-by: Victor Morales <victor.morales@intel.com>
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
}