diff options
Diffstat (limited to 'bootstrap/vagrant-onap/lib')
-rwxr-xr-x | bootstrap/vagrant-onap/lib/appc | 49 | ||||
-rwxr-xr-x | bootstrap/vagrant-onap/lib/sdnc | 26 |
2 files changed, 39 insertions, 36 deletions
diff --git a/bootstrap/vagrant-onap/lib/appc b/bootstrap/vagrant-onap/lib/appc index 8ad73561f..a0959c67a 100755 --- a/bootstrap/vagrant-onap/lib/appc +++ b/bootstrap/vagrant-onap/lib/appc @@ -3,44 +3,41 @@ set -o xtrace source /var/onap/sdnc -source /var/onap/asserts +source /var/onap/functions + +appc_src_folder=$git_src_folder/appc # clone_all_appc_repos() - Function that clones APPC source repo. function clone_all_appc_repos { - local src_folder=/opt/appc - - clone_repo appc $src_folder - clone_repo appc/deployment $src_folder/deployment + clone_repo appc $appc_src_folder + clone_repo appc/deployment $appc_src_folder/deployment } # compile_all_appc_repos() - Function that compiles APPC source repo. function compile_all_appc_repos { - local src_folder=/opt/appc - - compile_src $src_folder - compile_src $src_folder/deployment + compile_src $appc_src_folder + compile_src $appc_src_folder/deployment } -# install_appc() - Function that clones and installs the APPC services from source code -function install_appc { - install_package unzip - local src_folder=/opt/appc - - clone_all_appc_repos - if [[ "$compile_repo" == "True" ]]; then - compile_all_appc_repos - fi +# _build_appc_images() - Function that creates APPC images from source code. +function _build_appc_images { + get_sdnc_images + build_docker_image $appc_src_folder/deployment/installation/appc docker +} +# get_appc_images() - Function that gets or build APPC docker images +function get_appc_images { if [[ "$build_image" == "True" ]]; then - clone_repo sdnc/oam /opt/sdnc/oam - build_sdnc_images /opt/sdnc/oam - build_docker_image $src_folder/deployment/installation/appc docker - asserts_image openecomp/appc-image + _build_appc_images else pull_openecomp_image appc-image openecomp/appc-image:latest pull_openecomp_image dgbuilder-sdnc-image openecomp/dgbuilder-sdnc-image:latest fi - pushd $src_folder/deployment +} + +# install_appc() - Function that clones and installs the APPC services from source code +function install_appc { + pushd $appc_src_folder/deployment/docker-compose install_docker_compose /opt/docker/docker-compose up -d popd @@ -48,5 +45,11 @@ function install_appc { # init_appc() - Function that initialize APPC services function init_appc { + clone_all_appc_repos + if [[ "$compile_repo" == "True" ]]; then + compile_all_appc_repos + fi + + get_appc_images install_appc } diff --git a/bootstrap/vagrant-onap/lib/sdnc b/bootstrap/vagrant-onap/lib/sdnc index 332632138..9a3f9b032 100755 --- a/bootstrap/vagrant-onap/lib/sdnc +++ b/bootstrap/vagrant-onap/lib/sdnc @@ -4,13 +4,13 @@ set -o xtrace source /var/onap/functions -src_folder=$git_src_folder/openecomp/sdnc +sdnc_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 + clone_repo sdnc/$dirc $sdnc_src_folder/$dirc done } @@ -18,21 +18,21 @@ function clone_all_sdnc_repos { function compile_all_sdnc_repos { for dirc in ${sdnc_repos[@]}; do if [[ "$dirc" == "core" ]]; then - compile_src $src_folder/core/rootpom + compile_src $sdnc_src_folder/core/rootpom fi - compile_src $src_folder/$dirc + compile_src $sdnc_src_folder/$dirc done } -# build_sdnc_images() - Builds SDNC images from source code -function build_sdnc_images { - local folder=${1:-$src_folder/oam} +# _build_sdnc_images() - Builds SDNC images from source code +function _build_sdnc_images { + local folder=$sdnc_src_folder/oam install_package unzip - clone_repo sdnc/oam $src_folder/oam + clone_repo sdnc/oam $folder # The OAM code depends on all the SDNC repos which should be downloaded and compiled first - if [[ "$compile_repo" == "False" ]]; then - compile_src $src_folder/oam/ + if [[ "$compile_repo" != "True" ]]; then + compile_src $folder fi for dirc in ubuntu sdnc admportal dgbuilder; do build_docker_image $folder/installation/$dirc @@ -42,7 +42,7 @@ function build_sdnc_images { # get_sdnc_images() - Build or retrieve necessary images function get_sdnc_images { if [[ "$build_image" == "True" ]]; then - build_sdnc_images + _build_sdnc_images else pull_openecomp_image sdnc-image openecomp/sdnc-image:latest pull_openecomp_image admportal-sdnc-image openecomp/admportal-sdnc-image:latest @@ -53,8 +53,8 @@ function get_sdnc_images { # install_sdnc() - Download and install SDNC services from source code function install_sdnc { - clone_repo sdnc/oam $src_folder/oam - pushd $src_folder/oam/installation/src/main/yaml + clone_repo sdnc/oam $sdnc_src_folder/oam + pushd $sdnc_src_folder/oam/installation/src/main/yaml install_docker_compose /opt/docker/docker-compose up -d popd |