From bf1e7f0d0f88f5645f2e0b97dcbf885b69251b58 Mon Sep 17 00:00:00 2001 From: Idan Amit Date: Sun, 20 Aug 2017 16:05:46 +0300 Subject: Changed asdc script back to sdc The I2eb9ff087d3cfd61c0c1347d085dd02da64c2d89 change allows to revert this change Change-Id: Iafb1d2455f7f1b06b218b4bc1509177823d89dc2 Issue-Id: INT-101 Signed-off-by: Idan Amit Signed-off-by: Victor Morales --- bootstrap/vagrant-onap/Vagrantfile | 4 +- bootstrap/vagrant-onap/lib/asdc | 111 ------------------------------------- bootstrap/vagrant-onap/lib/sdc | 111 +++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+), 113 deletions(-) delete mode 100755 bootstrap/vagrant-onap/lib/asdc create mode 100644 bootstrap/vagrant-onap/lib/sdc (limited to 'bootstrap') diff --git a/bootstrap/vagrant-onap/Vagrantfile b/bootstrap/vagrant-onap/Vagrantfile index e39ccbd62..5eb22d71f 100644 --- a/bootstrap/vagrant-onap/Vagrantfile +++ b/bootstrap/vagrant-onap/Vagrantfile @@ -160,7 +160,7 @@ Vagrant.configure("2") do |config| end all_in_one.vm.provision 'shell' do |s| s.path = 'vagrant_utils/postinstall.sh' - s.args = ['mr', 'asdc', 'aai', 'mso', 'robot', 'vid', 'sdnc', 'portal', 'dcae', 'policy', 'appc', 'vfc'] + s.args = ['mr', 'sdc', 'aai', 'mso', 'robot', 'vid', 'sdnc', 'portal', 'dcae', 'policy', 'appc', 'vfc'] s.env = conf end end @@ -217,7 +217,7 @@ Vagrant.configure("2") do |config| end sdc.vm.provision 'shell' do |s| s.path = 'vagrant_utils/postinstall.sh' - s.args = ['asdc'] + s.args = ['sdc'] s.env = conf end end diff --git a/bootstrap/vagrant-onap/lib/asdc b/bootstrap/vagrant-onap/lib/asdc deleted file mode 100755 index fb7b40b04..000000000 --- a/bootstrap/vagrant-onap/lib/asdc +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash - -set -o xtrace - -source /var/onap/functions -source /var/onap/asserts - -src_folder=$git_src_folder/sdc - -# mount_external_partition() - Create partition and mount the external volume -function mount_external_partition { - cat < /tmp/asdc_ext_volume_partitions.txt -# partition table of /dev/sdb -unit: sectors - -/dev/sdb1 : start= 2048, size=209713152, Id=83 -/dev/sdb2 : start= 0, size= 0, Id= 0 -/dev/sdb3 : start= 0, size= 0, Id= 0 -/dev/sdb4 : start= 0, size= 0, Id= 0 -EOL - sfdisk --force /dev/sdb < /tmp/asdc_ext_volume_partitions.txt - mkfs -t ext4 /dev/sdb1 - mkdir -p /data - mount /dev/sdb1 /data - echo "/dev/sdb1 /data ext4 errors=remount-ro,noatime,barrier=0 0 1" >> /etc/fstab -} - -# init_data_folders() - Function that initialize the data folders -function init_data_folders { - mkdir -p /data/environments - mkdir -p /data/scripts - mkdir -p /data/logs/BE - mkdir -p /data/logs/FE - chmod 777 /data - chmod 777 /data/logs -} - -# setup_docker_aliases() - Function that setups the aliases required by sdc scripts -function setup_docker_aliases { - cat < /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 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 $src_folder - - for dirc in sdc-os-chef jtosca sdc-distribution-client sdc-titan-cassandra sdc-tosca sdc_common ; do - clone_repo sdc/$dirc $src_folder/$dirc - done -} - -# compile_all_sdc_repos() - Function that compiles SDC source repo. -function compile_all_sdc_repos { - local src_folder=/opt/sdc - clone_repo sdc $src_folder - - for dirc in jtosca sdc-distribution-client sdc-titan-cassandra sdc-tosca sdc_common ; do - compile_src $src_folder/$dirc - done -} - -# install_sdc() - Function that pull templates and executes -function install_sdc { - local ENV_NAME=$dmaap_topic - local MR_IP_ADDR='10.0.11.1' - local RELEASE=$docker_version - NEXUS_DOCKER_PORT=$(echo $nexus_docker_repo | cut -d':' -f2) - - if [[ "$build_image" == "True" ]]; then - compile_src $src_folder - build_docker_image $src_folder/sdc-os-chef docker - for image in backend frontend elasticsearch kibana cassandra sanity; do - asserts_image openecomp/sdc-$image - done - fi - cp $src_folder/sdc-os-chef/environments/Template.json /data/environments - cp $src_folder/sdc-os-chef/scripts/docker_run.sh /data/scripts - cp $src_folder/sdc-os-chef/scripts/docker_health.sh /data/scripts - chmod +x /data/scripts/docker_run.sh - chmod +x /data/scripts/docker_health.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 - 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 - - 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 -function init_asdc { - mount_external_partition - init_data_folders - setup_docker_aliases - if [[ "$clone_repo" == "True" ]]; then - clone_all_sdc_repos - if [[ "$compile_repo" == "True" ]]; then - compile_all_sdc_repos - fi - fi - install_sdc -} diff --git a/bootstrap/vagrant-onap/lib/sdc b/bootstrap/vagrant-onap/lib/sdc new file mode 100644 index 000000000..9d64d57da --- /dev/null +++ b/bootstrap/vagrant-onap/lib/sdc @@ -0,0 +1,111 @@ +#!/bin/bash + +set -o xtrace + +source /var/onap/functions +source /var/onap/asserts + +src_folder=$git_src_folder/sdc + +# mount_external_partition() - Create partition and mount the external volume +function mount_external_partition { + cat < /tmp/sdc_ext_volume_partitions.txt +# partition table of /dev/sdb +unit: sectors + +/dev/sdb1 : start= 2048, size=209713152, Id=83 +/dev/sdb2 : start= 0, size= 0, Id= 0 +/dev/sdb3 : start= 0, size= 0, Id= 0 +/dev/sdb4 : start= 0, size= 0, Id= 0 +EOL + sfdisk --force /dev/sdb < /tmp/sdc_ext_volume_partitions.txt + mkfs -t ext4 /dev/sdb1 + mkdir -p /data + mount /dev/sdb1 /data + echo "/dev/sdb1 /data ext4 errors=remount-ro,noatime,barrier=0 0 1" >> /etc/fstab +} + +# init_data_folders() - Function that initialize the data folders +function init_data_folders { + mkdir -p /data/environments + mkdir -p /data/scripts + mkdir -p /data/logs/BE + mkdir -p /data/logs/FE + chmod 777 /data + chmod 777 /data/logs +} + +# setup_docker_aliases() - Function that setups the aliases required by sdc scripts +function setup_docker_aliases { + cat < /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 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 $src_folder + + for dirc in sdc-os-chef jtosca sdc-distribution-client sdc-titan-cassandra sdc-tosca sdc_common ; do + clone_repo sdc/$dirc $src_folder/$dirc + done +} + +# compile_all_sdc_repos() - Function that compiles SDC source repo. +function compile_all_sdc_repos { + local src_folder=/opt/sdc + clone_repo sdc $src_folder + + for dirc in jtosca sdc-distribution-client sdc-titan-cassandra sdc-tosca sdc_common ; do + compile_src $src_folder/$dirc + done +} + +# install_sdc() - Function that pull templates and executes +function install_sdc { + local ENV_NAME=$dmaap_topic + local MR_IP_ADDR='10.0.11.1' + local RELEASE=$docker_version + NEXUS_DOCKER_PORT=$(echo $nexus_docker_repo | cut -d':' -f2) + + if [[ "$build_image" == "True" ]]; then + compile_src $src_folder + build_docker_image $src_folder/sdc-os-chef docker + for image in backend frontend elasticsearch kibana cassandra sanity; do + asserts_image openecomp/sdc-$image + done + fi + cp $src_folder/sdc-os-chef/environments/Template.json /data/environments + cp $src_folder/sdc-os-chef/scripts/docker_run.sh /data/scripts + cp $src_folder/sdc-os-chef/scripts/docker_health.sh /data/scripts + chmod +x /data/scripts/docker_run.sh + chmod +x /data/scripts/docker_health.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 + 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 + + 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_sdc() - Function that initialize SDC services +function init_sdc { + mount_external_partition + init_data_folders + setup_docker_aliases + if [[ "$clone_repo" == "True" ]]; then + clone_all_sdc_repos + if [[ "$compile_repo" == "True" ]]; then + compile_all_sdc_repos + fi + fi + install_sdc +} -- cgit 1.2.3-korg