diff options
Diffstat (limited to 'bootstrap/vagrant-onap/lib/sdc')
-rwxr-xr-x[-rw-r--r--] | bootstrap/vagrant-onap/lib/sdc | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/bootstrap/vagrant-onap/lib/sdc b/bootstrap/vagrant-onap/lib/sdc index 9ec04b21b..a21e2a418 100644..100755 --- a/bootstrap/vagrant-onap/lib/sdc +++ b/bootstrap/vagrant-onap/lib/sdc @@ -5,7 +5,9 @@ set -o xtrace source /var/onap/functions sdc_src_folder=$git_src_folder/sdc -sdc_repos=("jtosca" "sdc-distribution-client" "sdc-docker-base" "sdc-titan-cassandra" "sdc-tosca" "sdc-vnfdesign" "sdc-workflow-designer" "sdc_common") +sdc_repos=("sdc" "sdc/jtosca" "sdc/sdc-distribution-client" +"sdc/sdc-docker-base" "sdc/sdc-titan-cassandra" "sdc/sdc-tosca" +"sdc/sdc-vnfdesign" "sdc/sdc-workflow-designer" "sdc/sdc_common") # _mount_external_partition() - Create partition and mount the external volume function _mount_external_partition { @@ -40,39 +42,32 @@ function _setup_docker_aliases { cat <<EOL > /root/.bash_aliases alias dcls='/data/scripts/docker_clean.sh \$1' alias dlog='/data/scripts/docker_login.sh \$1' -alias rund='/data/scripts/docker_run.sh' +alias drun='/data/scripts/docker_run.sh' alias health='/data/scripts/docker_health.sh' EOL } # clone_all_sdc_repos() - Function that clones SDC source repo. function clone_all_sdc_repos { - clone_repo sdc $sdc_src_folder - - for dirc in ${sdc_repos[@]}; do - clone_repo sdc/$dirc $sdc_src_folder/$dirc + for repo in ${sdc_repos[@]}; do + clone_repo $repo $sdc_src_folder${repo#*sdc} done } # compile_all_sdc_repos() - Function that compiles SDC source repo. function compile_all_sdc_repos { - compile_src sdc $sdc_src_folder - - for dirc in ${sdc_repos[@]}; do - compile_src $sdc_src_folder/$dirc + for repo in ${sdc_repos[@]}; do + compile_src $sdc_src_folder${repo#*sdc} done } # get_sdc_images() - Function that retrieves the SDC docker images function get_sdc_images { if [[ "$build_image" == "True" ]]; then - if [[ "$compile_repo" != "True" ]]; then - compile_src $sdc_src_folder - fi build_docker_image $sdc_src_folder/sdc-docker-base else for image in backend frontend elasticsearch kibana cassandra sanity; do - pull_openecomp_image openecomp/sdc-$image + pull_openecomp_image openecomp/sdc-$image done fi } @@ -86,8 +81,12 @@ function install_sdc { cp $sdc_src_folder/sdc-os-chef/environments/Template.json /data/environments cp $sdc_src_folder/sdc-os-chef/scripts/docker_run.sh /data/scripts cp $sdc_src_folder/sdc-os-chef/scripts/docker_health.sh /data/scripts + cp $sdc_src_folder/sdc-os-chef/scripts/docker_login.sh /data/scripts + cp $sdc_src_folder/sdc-os-chef/scripts/docker_clean.sh /data/scripts chmod +x /data/scripts/docker_run.sh chmod +x /data/scripts/docker_health.sh + chmod +x /data/scripts/docker_login.sh + chmod +x /data/scripts/docker_clean.sh cat /data/environments/Template.json | sed "s/yyy/"$IP_ADDRESS"/g" > /data/environments/$ENV_NAME.json sed -i "s/xxx/"$ENV_NAME"/g" /data/environments/$ENV_NAME.json @@ -95,11 +94,10 @@ function install_sdc { sed -i "s/\"fqdn\":.*/\"fqdn\": [\""$MR_IP_ADDR"\", \""$MR_IP_ADDR"\"]/g" /data/environments/$ENV_NAME.json install_docker - if [[ "$pull_docker_image" == "True" ]]; then - docker_openecomp_login - bash /data/scripts/docker_run.sh -e $ENV_NAME -r $docker_version -p $(echo $nexus_docker_repo | cut -d':' -f2) - else + if [[ "$skip_get_images" == "False" ]]; then bash /data/scripts/docker_run.sh -e $ENV_NAME -l + else + bash /data/scripts/docker_run.sh -e $ENV_NAME -r $docker_version -p $(echo $nexus_docker_repo | cut -d':' -f2) fi } @@ -112,7 +110,12 @@ function init_sdc { compile_all_sdc_repos fi fi - get_sdc_images - install_sdc + + if [[ "$skip_get_images" == "False" ]]; then + get_sdc_images + fi + if [[ "$skip_install" == "False" ]]; then + install_sdc + fi _setup_docker_aliases } |