diff options
Diffstat (limited to 'bootstrap/vagrant-onap/lib')
-rwxr-xr-x | bootstrap/vagrant-onap/lib/aai | 22 | ||||
-rwxr-xr-x | bootstrap/vagrant-onap/lib/appc | 49 | ||||
-rwxr-xr-x | bootstrap/vagrant-onap/lib/asdc | 10 | ||||
-rwxr-xr-x | bootstrap/vagrant-onap/lib/sdnc | 26 |
4 files changed, 55 insertions, 52 deletions
diff --git a/bootstrap/vagrant-onap/lib/aai b/bootstrap/vagrant-onap/lib/aai index 4d828557f..cbf5c5f7d 100755 --- a/bootstrap/vagrant-onap/lib/aai +++ b/bootstrap/vagrant-onap/lib/aai @@ -5,7 +5,7 @@ set -o xtrace source /var/onap/functions hbase_version=1.2.3 -src_folder=$git_src_folder/aai +aai_src_folder=$git_src_folder/aai aai_repos=("aai-common" "aai-config" "aai-data" "aai-service" "data-router" "logging-service" "model-loader" "resources" "rest-client" "router-core" "search-data-service" "test-config" "traversal" "sparky-fe" "sparky-be") # install_hadoop() - Function that installs Hadoop @@ -48,7 +48,7 @@ function install_haproxy { # clone_all_aai_repos() - Function that clones AAI source repo. function clone_all_aai_repos { for dirc in ${aai_repos[@]}; do - clone_repo aai/$dirc $src_folder/$dirc + clone_repo aai/$dirc $aai_src_folder/$dirc done } @@ -60,7 +60,7 @@ function compile_aai_repos { fi for dirc in ${repos[@]}; do - compile_src $src_folder/$dirc + compile_src $aai_src_folder/$dirc done } @@ -71,15 +71,15 @@ function setup_titan { for dirc in resources/aai-resources traversal/aai-travers; do for file in titan-cached.properties titan-realtime.properties; do - crudini --set --existing $src_folder/$dirc/$subdirectory/$file "" storage.backend cassandra - crudini --set --existing $src_folder/$dirc/$subdirectory/$file "" storage.hostname localhost + crudini --set --existing $aai_src_folder/$dirc/$subdirectory/$file "" storage.backend cassandra + crudini --set --existing $aai_src_folder/$dirc/$subdirectory/$file "" storage.hostname localhost done done # Addthe schema to the local isntance - pushd $src_folder + pushd $aai_src_folder install_java - java -DAJSC_HOME=$src_folder/resources/aai-resources -DBUNDLECONFIG_DIR="bundleconfig-local" -cp aai-common/aai-core/target/aai-core-1.1.0-SNAPSHOT.jar:resources/aai-resources/target/aai-resources.jar:resources/aai-resources/target/userjars/* org.openecomp.aai.dbgen.GenTester + java -DAJSC_HOME=$aai_src_folder/resources/aai-resources -DBUNDLECONFIG_DIR="bundleconfig-local" -cp aai-common/aai-core/target/aai-core-1.1.0-SNAPSHOT.jar:resources/aai-resources/target/aai-resources.jar:resources/aai-resources/target/userjars/* org.openecomp.aai.dbgen.GenTester popd } @@ -87,7 +87,7 @@ function setup_titan { function start_aai_microservices { MAVEN_OPTS="-Xms1024m -Xmx5120m -XX:PermSize=2024m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=9446,server=y,suspend=n" for svc in resources traversal; do - pushd $src_folder/resources + pushd $aai_src_folder/resources mvn -P runAjsc popd done @@ -116,7 +116,7 @@ docker_gitbranch=master EOL docker rm -f aai-service if [[ "$build_image" == "True" ]]; then - build_docker_image $src_folder/aai-service/ajsc-aai + build_docker_image $aai_src_folder/aai-service/ajsc-aai else pull_openecomp_image ajsc-aai fi @@ -126,7 +126,6 @@ EOL # install_model_loader() Install Model Loader function install_model_loader { - local src_folder=/opt/aai/model-loader/ cat <<EOL > /etc/model-loader.conf DISTR_CLIENT_ASDC_ADDRESS=${SDC_ADDRESS:-c2.vm1.sdc.simpledemo.openecomp.org:8443} DISTR_CLIENT_CONSUMER_GROUP=${UEB_CONSUMER_GROUP:-SDCGroup} @@ -145,8 +144,7 @@ EOL docker rm -f model-loader-service if [[ "$build_image" == "True" ]]; then - clone_repo aai/model-loader $src_folder - build_docker_image $src_folder + build_docker_image $aai_src_folder/model-loader/ ARGS+="--env-file /etc/model-loader.conf model-loader" else pull_openecomp_image model-loader 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/asdc b/bootstrap/vagrant-onap/lib/asdc index 0c09b0b64..bbd3d3bc5 100755 --- a/bootstrap/vagrant-onap/lib/asdc +++ b/bootstrap/vagrant-onap/lib/asdc @@ -32,8 +32,7 @@ function init_data_folders { mkdir -p /data/logs/BE mkdir -p /data/logs/FE chmod 777 /data - chmod 777 /data/logs/BE - chmod 777 /data/logs/FE + chmod 777 /data/logs } # setup_docker_aliases() - Function that setups the aliases required by sdc scripts @@ -95,8 +94,11 @@ function install_sdc { sed -i "s/\"ueb_url_list\":.*/\"ueb_url_list\": \""$MR_IP_ADDR","$MR_IP_ADDR"\",/g" /data/environments/$ENV_NAME.json sed -i "s/\"fqdn\":.*/\"fqdn\": [\""$MR_IP_ADDR"\", \""$MR_IP_ADDR"\"]/g" /data/environments/$ENV_NAME.json - docker_openecomp_login - bash /data/scripts/docker_run.sh -e $ENV_NAME -r $RELEASE -p $NEXUS_DOCKER_PORT + install_docker + if [[ "$pull_docker_image" == "True" ]]; then + docker_openecomp_login + bash /data/scripts/docker_run.sh -e $ENV_NAME -r $RELEASE -p $NEXUS_DOCKER_PORT + fi } # init_asdc() - Function that initialize SDC services 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 |