aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/lib/portal
blob: 6c8e7d0a91e3c3439b99fe80ef9e7f0526b07635 (plain) @media only all and (prefers-color-scheme: dark) { .highlight .hll { background-color: #49483e } .highlight .c { color: #75715e } /* Comment */ .highlight .err { color: #960050; background-color: #1e0010 } /* Error */ .highlight .k { color: #66d9ef } /* Keyword */ .highlight .l { color: #ae81ff } /* Literal */ .highlight .n { color: #f8f8f2 } /* Name */ .highlight .o { color: #f92672 } /* Operator */ .highlight .p { color: #f8f8f2 } /* Punctuation */ .highlight .ch { color: #75715e } /* Comment.Hashbang */ .highlight .cm { color: #75715e } /* Comment.Multiline */ .highlight .cp { color: #75715e } /* Comment.Preproc */ .highlight .cpf { color: #75715e } /* Comment.PreprocFile */ .highlight .c1 { color: #75715e } /* Comment.Single */ .highlight .cs { color: #75715e } /* Comment.Special */ .highlight .gd { color: #f92672 } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gi { color: #a6e22e } /* Generic.Inserted */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #75715e } /* Generic.Subheading */ .highlight .kc { color: #66d9ef } /* Keyword.Constant */ .highlight .kd { color: #66d9ef } /* Keyword.Declaration */ .highlight .kn { color: #f92672 } /* Keyword.Namespace */ .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */ .highlight .kr { color: #66d9ef } /* Keyword.Reserved */ .highlight .kt { color: #66d9ef } /* Keyword.Type */ .highlight .ld { color: #e6db74 } /* Literal.Date */ .highlight .m { color: #ae81ff } /* Literal.Number */ .highlight .s { color: #e6db74 } /* Literal.String */ .highlight .na { color: #a6e22e } /* Name.Attribute */ .highlight .nb { color: #f8f8f2 } /* Name.Builtin */ .highlight .nc { color: #a6e22e } /* Name.Class */ .highlight .no { color: #66d9ef } /* Name.Constant */ .highlight .nd { color: #a6e22e } /* Name.Decorator */ .highlight .ni { color: #f8f8f2 } /* Name.Entity */ .highlight .ne { color: #a6e22e } /* Name.Exception */ .highlight .nf { color: #a6e22e } /* Name.Function */ .highlight .nl { color: #f8f8f2 } /* Name.Label */ .highlight .nn { color: #f8f8f2 } /* Name.Namespace */ .highlight .nx { color: #a6e22e } /* Name.Other */ .highlight .py { color: #f8f8f2 } /* Name.Property */ .highlight .n
#!/bin/bash

set -o xtrace

source /var/onap/functions
source /var/onap/asserts

# install_mariadb() - Pull and create a MariaDB container
function install_mariadb {
    is_package_installed docker-ce || install_docker
    docker pull mariadb
    docker create --name data_vol_portal -v /var/lib/mysql mariadb
}

# install_portal() - Function that pulls and install the source code of Portal
function install_portal {
    local src_folder=/opt/portal
    clone_repo portal $src_folder
    clone_repo portal/sdk $src_folder/sdk
    install_docker
    docker rm -f ecompdb_portal
    docker rm -f 1610-1
    pushd $src_folder/deliveries
    if [[ "$build_image" == "True" ]]; then
        install_maven

        clone_repo ecompsdkos $src_folder/ecompsdkos
        clone_repo "ui/dmaapbc" $src_folder/dmaapbc
        chmod +x *.sh
        export MVN=$(which mvn)
        export GLOBAL_SETTINGS_FILE=/usr/share/maven3/conf/settings.xml
        export SETTINGS_FILE=$HOME/.m2/settings.xml
        bash run.sh
        compile_src $src_folder/ecomp-portal-widget-ms
        build_docker_image $src_folder/ecomp-portal-widget-ms
    else
        pull_openecomp_image portaldb ecompdb:portal
        pull_openecomp_image portalapps ep:1610-1

    fi
    for image in ecompdb:portal ep:1610-1; do
        asserts_image $image
    done

    chmod +x new_start.sh
    chmod +x new_stop.sh
    chmod +x dbstart.sh
    mkdir -p /PROJECT/OpenSource/UbuntuEP/logs
    install_package unzip
    unzip -o etc.zip -d /PROJECT/OpenSource/UbuntuEP/

    bash dbstart.sh
    bash new_start.sh

    sleep 180

    if [ ! -e /opt/config/boot.txt ]; then
        IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
        install_package mysql-client
        mysql -u root -p'Aa123456' -h $IP_ADDRESS < Apps_Users_OnBoarding_Script.sql
        echo "yes" > /opt/config/boot.txt
    fi
    popd
}

# init_portal() - Function that initialize Portal services
function init_portal {
    install_mariadb
    install_portal
}