summaryrefslogtreecommitdiffstats
path: root/boot
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-04-04 21:53:21 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-04 21:53:21 +0000
commitf629942716821374d8c7d17567a89ee3896770ad (patch)
treeffce6b3fef13e5a70556a77702a0c207dc4268dc /boot
parente13fb1a162861b9ca3e703a671ccd6971fcc0128 (diff)
parent8533616f90d28b89be5bb3598cb87e98ca51fe2e (diff)
Merge "Imporve dcae2 init scripts"
Diffstat (limited to 'boot')
-rwxr-xr-xboot/dcae2_install.sh3
-rwxr-xr-xboot/dcae2_vm_init.sh54
2 files changed, 55 insertions, 2 deletions
diff --git a/boot/dcae2_install.sh b/boot/dcae2_install.sh
index b59f06f2..3446b6c2 100755
--- a/boot/dcae2_install.sh
+++ b/boot/dcae2_install.sh
@@ -139,7 +139,8 @@ if [ "$DEPLOYMENT_PROFILE" == "R2MVP" ]; then
RELEASE_TAG='R2'
rm -rf /opt/app/inputs-templates
mkdir -p /opt/app/inputs-templates
- wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_DEPLOYMENTS}/${RELEASE_TAG}/heat/${DEPLOYMENT_PROFILE}/docker-compose.yaml
+ wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_DEPLOYMENTS}/${RELEASE_TAG}/heat/${DEPLOYMENT_PROFILE}/docker-compose-1.yaml
+ wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_DEPLOYMENTS}/${RELEASE_TAG}/heat/${DEPLOYMENT_PROFILE}/docker-compose-2.yaml
pip install --upgrade jinja2
wget https://${URL_ROOT}/${REPO_DEPLOYMENTS}/${RELEASE_TAG}/scripts/detemplate-bpinputs.py && \
diff --git a/boot/dcae2_vm_init.sh b/boot/dcae2_vm_init.sh
index 581c0bf1..ac6713d0 100755
--- a/boot/dcae2_vm_init.sh
+++ b/boot/dcae2_vm_init.sh
@@ -685,6 +685,58 @@ fi
if [ "$DEPLOYMENT_PROFILE" == "R2MVP" ]; then
cd /opt/app/config
- /opt/docker/docker-compose up -d
+ /opt/docker/docker-compose -f docker-compose-1.yaml up -d
+ echo "Waiting for Consul to come up ready"
+ while ! nc -z localhost 8500; do sleep 1; done
+ echo "Waiting for DB to come up ready"
+ while ! nc -z localhost 5432; do sleep 1; done
+ echo "Waiting for CBS to come up ready"
+ while ! nc -z localhost 10000; do sleep 1; done
+ echo "All dependencies are up, proceed to the next phase"
+ sleep 5
+
+ NAME='config_binding_service'
+ PORT='10000'
+ ID=$(sudo docker ps |grep "$NAME" |cut -b1-12)
+ while [ -z "$ID" ]; do echo "Waiting for $NAME container to be deployed"; sleep 1; ID=$(sudo docker ps |grep "$NAME" |cut -b1-12); done
+ REG='{"ID": "'"$NAME"'0", "Name": "'"$NAME"'", "Address": "'"$NAME"'", "Port": '"$PORT"'}'
+ curl -v -X PUT -H "Content-Type: application/json" --data "${REG}" http://localhost:8500/v1/agent/service/register
+
+ sleep 5
+ echo "Now bring up DCAE service components"
+ /opt/docker/docker-compose -f docker-compose-2.yaml up -d
+
+
+ NAME='ves'
+ PORT='8080'
+ echo "Registering for $NAME:$PORT"
+ ID=$(sudo docker ps |grep "$NAME" |cut -b1-12)
+ while [ -z "$ID" ]; do echo "Waiting for $NAME container to be deployed"; sleep 1; ID=$(sudo docker ps |grep "$NAME" |cut -b1-12); done
+ REG='{"ID": "'"$NAME"'", "Name": "'"$NAME"'", "Address": "'"$NAME"'", "Port": '"$PORT"'}'
+ curl -v -X PUT -H "Content-Type: application/json" --data "${REG}" http://localhost:8500/v1/agent/service/register
+
+ NAME='tca'
+ PORT='11011'
+ echo "Registering for $NAME:$PORT"
+ ID=$(sudo docker ps |grep "$NAME" |cut -b1-12)
+ while [ -z "$ID" ]; do echo "Waiting for $NAME container to be deployed"; sleep 1; ID=$(sudo docker ps |grep "$NAME" |cut -b1-12); done
+ REG='{"ID": "'"$NAME"'", "Name": "'"$NAME"'", "Address": "'"$NAME"'", "Port": '"$PORT"'}'
+ curl -v -X PUT -H "Content-Type: application/json" --data "${REG}" http://localhost:8500/v1/agent/service/register
+
+ NAME='hr'
+ PORT='9101'
+ echo "Registering for $NAME:$PORT"
+ ID=$(sudo docker ps |grep "$NAME" |cut -b1-12)
+ while [ -z "$ID" ]; do echo "Waiting for $NAME container to be deployed"; sleep 1; ID=$(sudo docker ps |grep "$NAME" |cut -b1-12); done
+ REG='{"ID": "'"$NAME"'", "Name": "'"$NAME"'", "Address": "'"$NAME"'", "Port": '"$PORT"'}'
+ curl -v -X PUT -H "Content-Type: application/json" --data "${REG}" http://localhost:8500/v1/agent/service/register
+
+ NAME='he'
+ PORT='9102'
+ echo "Registering for $NAME:$PORT"
+ ID=$(sudo docker ps |grep "$NAME" |cut -b1-12)
+ while [ -z "$ID" ]; do echo "Waiting for $NAME container to be deployed"; sleep 1; ID=$(sudo docker ps |grep "$NAME" |cut -b1-12); done
+ REG='{"ID": "'"$NAME"'", "Name": "'"$NAME"'", "Address": "'"$NAME"'", "Port": '"$PORT"'}'
+ curl -v -X PUT -H "Content-Type: application/json" --data "${REG}" http://localhost:8500/v1/agent/service/register
fi