summaryrefslogtreecommitdiffstats
path: root/boot/dbcl_vm_init.sh
diff options
context:
space:
mode:
authorDominic Lunanuova <dgl@research.att.com>2018-04-06 22:05:42 +0000
committerDominic Lunanuova <dgl@research.att.com>2018-04-09 15:28:53 +0000
commit32bb82bea98eb20313c35600c7a58eec9359d8fa (patch)
tree69fdb9510c190b82ee4454261cea697b68cbdf29 /boot/dbcl_vm_init.sh
parentdb228e6370e5257ca59e4f0e7154f45991c7defa (diff)
Iniital boot scripts for dmaap-buscontroller
Patch 2 corrects domain for integration: simpledemo.onap.org Patch 3 merge with mr scripts so share 1 VM. Also use correct bindings. Change-Id: I2431dcecab13c8ef480de59d79fb807d3b2e5b8d Signed-off-by: Dominic Lunanuova <dgl@research.att.com> Issue-ID: DMAAP-125 Signed-off-by: Dominic Lunanuova <dgl@research.att.com>
Diffstat (limited to 'boot/dbcl_vm_init.sh')
-rw-r--r--boot/dbcl_vm_init.sh83
1 files changed, 83 insertions, 0 deletions
diff --git a/boot/dbcl_vm_init.sh b/boot/dbcl_vm_init.sh
new file mode 100644
index 00000000..ba9859ad
--- /dev/null
+++ b/boot/dbcl_vm_init.sh
@@ -0,0 +1,83 @@
+#!/bin/bash
+
+# Establish environment variables
+NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt)
+NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt)
+NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt)
+DOCKER_IMAGE_VERSION=$(cat /opt/config/uui_docker.txt)
+
+# Refresh images
+docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
+docker pull $NEXUS_DOCKER_REPO/onap/dmaap/buscontroller:$DOCKER_IMAGE_VERSION
+docker tag $NEXUS_DOCKER_REPO/onap/dmaap/buscontroller:$DOCKER_IMAGE_VERSION onap/dmaap/buscontroller:latest
+
+docker rm -f dmaap-buscontroller
+
+TMP_CFG=/tmp/docker-dmaap-buscontroller.conf
+cat >> $TMP_CFG <<!EOF
+DMAAPBC_INT_HTTPS_PORT=0
+DMAAPBC_PG_ENABLED=false
+DMAAPBC_INSTANCE_NAME=ONAP-CSIT
+DMAAPBC_AAF_URL=https://aaf.api.simpledemo.onap.org:8095/proxy/
+DMAAPBC_MR_CNAME=mr.api.simpledemo.onap.org
+DMAAPBC_DRPROV_FQDN=drprov.simpledemo.onap.org
+!EOF
+
+# Insert docker run instructions here
+docker run -i -t -d --name dmaap-buscontroller -p 8080:8080 -p 8443:8443 -v $TMP_CFG:/opt/app/config/conf $NEXUS_DOCKER_REPO/onap/dmaap/buscontroller:$DOCKER_IMAGE_VERSION
+
+DBCL_FQDN=dbc.api.simpledemo.onap.org
+DRPS_FQDN=drprov.simpledemo.onap.org
+MR_FQDN=mr.api.simpledemo.onap.org
+# INITIALIZE: dmaap object
+JSON=/tmp/$$.dmaap
+cat << EOF > $JSON
+{
+"version": "1",
+"topicNsRoot": "org.onap.dmaap",
+"drProvUrl": "http://${DRPS_FQDN}:8080",
+"dmaapName": "onapStable",
+"bridgeAdminTopic": "MM_AGENT_PROV"
+
+}
+EOF
+
+curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://${DBCL_FQDN}:8080/webapi/dmaap
+
+
+
+# INITIALIZE: dcaeLocation object
+JSON=/tmp/$$.loc
+cat << EOF > $JSON
+{
+"dcaeLocationName": "csit-sanfrancisco",
+"dcaeLayer": "central-cloud",
+"clli": "STABLE2345",
+"zone": "zoneA"
+
+}
+EOF
+
+curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://${DBCL_FQDN}:8080/webapi/dcaeLocations
+
+
+# INITIALIZE: MR object in 1 site
+# Note: the values in the hosts[] are fictitious, and anticipate a
+# future MR cluster deployment.
+JSON=/tmp/$$.mrc
+cat << EOF > $JSON
+{
+"dcaeLocationName": "stable-sanfrancisco",
+"fqdn": "${MR_FQDN}",
+"hosts" : [
+ "mrhost1.simpledemo.onap.org",
+ "mrhost2.simpledemo.onap.org",
+ "mrhost3.simpledemo.onap.org"
+ ],
+"protocol" : "https",
+"port": "3094"
+
+}
+EOF
+
+curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://${DBCL_FQDN}:8080/webapi/mr_clusters