aboutsummaryrefslogtreecommitdiffstats
path: root/boot/portal_vm_init.sh
blob: 744c4fc95a51d07cb62fb4c06fe6954d08627d2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

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 login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
docker pull $NEXUS_DOCKER_REPO/ecomp/portaldb:1610.3
docker pull $NEXUS_DOCKER_REPO/ecomp/portalapps:1610.3

docker create --name data_vol_portal -v /var/lib/mysql mariadb

docker tag 6ce6ea8c6e52 ecompdb:portal
docker tag 925a8a953d4c ep:1610-1

docker rm -f ecompdb_portal
docker rm -f 1610-1

./dbstart.sh
./new_start.sh

sleep 60

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