diff options
Diffstat (limited to 'installation/appc/src')
-rw-r--r-- | installation/appc/src/main/docker/Dockerfile | 10 | ||||
-rw-r--r-- | installation/appc/src/main/scripts/installFeatures.sh | 37 | ||||
-rw-r--r-- | installation/appc/src/main/scripts/installZips.sh | 59 | ||||
-rw-r--r-- | installation/appc/src/main/scripts/startODL.sh | 73 |
4 files changed, 179 insertions, 0 deletions
diff --git a/installation/appc/src/main/docker/Dockerfile b/installation/appc/src/main/docker/Dockerfile new file mode 100644 index 0000000..82f04ba --- /dev/null +++ b/installation/appc/src/main/docker/Dockerfile @@ -0,0 +1,10 @@ +# Base ubuntu with added packages needed for open ecomp +FROM ecomp/sdnc-image:latest +MAINTAINER APP-C Team (appc@lists.openecomp.org) + +# copy openecomp +COPY opt /opt +RUN ln -s /opt/openecomp/appc /opt/appc + +# ENTRYPOINT exec /opt/opendaylight/current/bin/karaf +EXPOSE 8181 diff --git a/installation/appc/src/main/scripts/installFeatures.sh b/installation/appc/src/main/scripts/installFeatures.sh new file mode 100644 index 0000000..a10b4c1 --- /dev/null +++ b/installation/appc/src/main/scripts/installFeatures.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +APPC_HOME=${APPC_HOME:-/opt/openecomp/appc} +APPC_FEATURE_DIR=${APPC_FEATURE_DIR:-${APPC_HOME}/features} + +APPC_FEATURES=" \ + appc-iaas-adapter \ + appc-provider \ + appc-event-listener \ + appc-dispatcher \ + appc-chef-adapter \ + appc-netconf-adapter \ + appc-rest-adapter \ + appc-dmaap-adapter \ + appc-dg-util \ + appc-metric \ + appc-dg-shared \ + appc-asdc-listener" + +echo "Enabling core APP-C features" +${ODL_HOME}/bin/client -u karaf feature:install odl-netconf-connector-all +${ODL_HOME}/bin/client -u karaf feature:install odl-restconf-noauth +${ODL_HOME}/bin/client -u karaf feature:install odl-netconf-topology + +echo "Installing APP-C Features" +echo "" + +for feature in ${APPC_FEATURES} +do + if [ -f ${APPC_FEATURE_DIR}/${feature}/install-feature.sh ] + then + ${APPC_FEATURE_DIR}/${feature}/install-feature.sh + else + echo "No installer found for feature ${feature}" + fi +done diff --git a/installation/appc/src/main/scripts/installZips.sh b/installation/appc/src/main/scripts/installZips.sh new file mode 100644 index 0000000..9e4d330 --- /dev/null +++ b/installation/appc/src/main/scripts/installZips.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +APPC_HOME=${APPC_HOME:-/opt/openecomp/appc} +SDNC_HOME=${SDNC_HOME:-/opt/openecomp/sdnc} + +targetDir=${1:-${APPC_HOME}} +sdnc_targetDir=${1:-${SDNC_HOME}} + +featureDir=${targetDir}/features + +APPC_FEATURES=" \ + appc-iaas-adapter \ + appc-provider \ + appc-event-listener \ + appc-dispatcher \ + appc-chef-adapter \ + appc-netconf-adapter \ + appc-rest-adapter \ + appc-dmaap-adapter \ + appc-dg-util \ + appc-metric \ + appc-dg-shared \ + appc-asdc-listener" + +APPC_VERSION=${APPC_VERSION:-0.0.1} +APPC_OAM_VERSION=${APPC_OAM_VERSION:-0.1.1} + +if [ ! -d ${targetDir} ] +then + mkdir -p ${targetDir} +fi + +if [ ! -d ${featureDir} ] +then + mkdir -p ${featureDir} +fi + +cwd=$(pwd) + +mavenOpts=${2:-"-s $cwd/../../jenkins-settings.xml"} +cd /tmp + +echo "Installing APP-C version ${APPC_VERSION}" +for feature in ${APPC_FEATURES} +do + rm -f /tmp/${feature}-installer*.zip + mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.appc:${feature}-installer:${APPC_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true + unzip -d ${featureDir} /tmp/${feature}-installer*zip +done + +echo "Installing platform-logic for APP-C" +rm -f /tmp/platform-logic-installer*.zip +mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.appc.deployment:platform-logic-installer:${APPC_OAM_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true +unzip -d ${targetDir} /tmp/platform-logic-installer*.zip + +find ${targetDir} -name '*.sh' -exec chmod +x '{}' \; + +cd $cwd + diff --git a/installation/appc/src/main/scripts/startODL.sh b/installation/appc/src/main/scripts/startODL.sh new file mode 100644 index 0000000..00702e3 --- /dev/null +++ b/installation/appc/src/main/scripts/startODL.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +# Install SDN-C & APP-C platform components if not already installed and start container + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} +SDNC_HOME=${SDNC_HOME:-/opt/openecomp/sdnc} +APPC_HOME=${APPC_HOME:-/opt/openecomp/appc} +SLEEP_TIME=${SLEEP_TIME:-120} +MYSQL_PASSWD=${MYSQL_PASSWD:-openECOMP1.0} + +# +# Adding the DMAAP_TOPIC_ENV variable into APPC-ASDC-LISTENER properties +# +DMAAP_TOPIC_ENV=${DMAAP_TOPIC_ENV} + +if [ -z "$DMAAP_TOPIC_ENV" ] + then + echo "DMAAP_TOPIC_ENV shell variable is empty. Adding default value OS-ETE-DFW" + DMAAP_TOPIC_ENV="OS-ETE-DFW" + else + echo "DMAAP_TOPIC_ENV shell variable exists and it's $DMAAP_TOPIC_ENV" +fi + + +echo "Adding a value to property appc.asdc.env in appc.properties for appc-asdc-listener feature" +echo "" >> $APPC_HOME/data/properties/appc.properties +echo "appc.asdc.env=$DMAAP_TOPIC_ENV" >> $APPC_HOME/data/properties/appc.properties +echo "" >> $APPC_HOME/data/properties/appc.properties + + + +# +# Wait for database to init properly +# +echo "Waiting for mysql" +until mysql -h dbhost -u root -p${MYSQL_PASSWD} mysql &> /dev/null +do + printf "." + sleep 1 +done +echo -e "\nmysql ready" + +if [ ! -f ${SDNC_HOME}/.installed ] +then + echo "Installing SDN-C database" + ${SDNC_HOME}/bin/installSdncDb.sh + echo "Starting OpenDaylight" + ${ODL_HOME}/bin/start + echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize" + sleep ${SLEEP_TIME} + echo "Installing SDN-C platform features" + ${SDNC_HOME}/bin/installFeatures.sh + if [ -x ${SDNC_HOME}/svclogic/bin/install.sh ] + then + echo "Installing directed graphs" + ${SDNC_HOME}/svclogic/bin/install.sh + fi + + echo "Installing APP-C platform features" + ${APPC_HOME}/bin/installFeatures.sh + if [ -x ${APPC_HOME}/svclogic/bin/install.sh ] + then + echo "Installing directed graphs for APP-C" + ${APPC_HOME}/svclogic/bin/install.sh + fi + + echo "Restarting OpenDaylight" + ${ODL_HOME}/bin/stop + echo "Installed at `date`" > ${SDNC_HOME}/.installed +fi + +exec ${ODL_HOME}/bin/karaf
\ No newline at end of file |