3 # destroy running instances if any
5 for container in $(docker ps -q)
7 echo "stopping container ${container}"
8 docker stop "${container}"
11 for container in $(docker ps -a -q)
13 echo "removing container ${container}"
14 docker rm -v "${container}"
17 # remove dangling resources
19 for volume in $(docker volume ls -qf dangling=true)
21 echo "removing volume ${volume}"
22 docker volume rm "${volume}"
25 for image in $(docker images -f dangling=true -q)
27 echo "removing image ${image}"
31 NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt)
32 NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt)
33 NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt)
34 DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt)
35 export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
36 export DOCKER_REPOSITORY=${NEXUS_DOCKER_REPO}
41 # download controlloop application
43 export ARTIFACT_VERSION=$(cat /opt/config/artifacts_version.txt)
45 chmod +x /opt/policy/config/drools/apps-install.sh
46 /opt/policy/config/drools/apps-install.sh controlloop ${ARTIFACT_VERSION} /opt/policy/config/drools
48 # ensure brmsgw dependency configuration is set up correctly
50 sed -i -e "s/^BRMS_DEPENDENCY_VERSION=.*$/BRMS_DEPENDENCY_VERSION=${ARTIFACT_VERSION}/g" /opt/policy/config/pe/brmsgw.conf
52 chmod +x config/drools/drools-tweaks.sh
54 if [ -e /opt/config/public_ip.txt ]
56 IP_ADDRESS=$(cat /opt/config/public_ip.txt)
58 IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
61 echo $IP_ADDRESS > config/pe/ip_addr.txt
63 docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
65 #docker pull $NEXUS_DOCKER_REPO/onap/policy-db:$DOCKER_IMAGE_VERSION
66 #docker tag $NEXUS_DOCKER_REPO/onap/policy-db:$DOCKER_IMAGE_VERSION onap/policy/policy-db:latest
68 docker pull $NEXUS_DOCKER_REPO/onap/policy-pe:$DOCKER_IMAGE_VERSION
69 docker tag $NEXUS_DOCKER_REPO/onap/policy-pe:$DOCKER_IMAGE_VERSION onap/policy-pe:latest
71 docker pull $NEXUS_DOCKER_REPO/onap/policy-drools:$DOCKER_IMAGE_VERSION
72 docker tag $NEXUS_DOCKER_REPO/onap/policy-drools:$DOCKER_IMAGE_VERSION onap/policy-drools:latest
74 docker pull $NEXUS_DOCKER_REPO/onap/policy-nexus:$DOCKER_IMAGE_VERSION
75 docker tag $NEXUS_DOCKER_REPO/onap/policy-nexus:$DOCKER_IMAGE_VERSION onap/policy-nexus:latest
77 /opt/docker/docker-compose up -d