aboutsummaryrefslogtreecommitdiffstats
path: root/deploy.sh
blob: 8a6edba0315248d319b0f589eaf8da45d821294f (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
30
#!/bin/bash

set -e

# do not change this, it is already matched with the git repo file structure
DOCKER_FILE_DIR="./docker_files"

# commands to run docker and docker-compose
DOCKER_COMPOSE_EXE="/opt/docker/docker-compose"
DOCKER_EXE="docker"


cd ${DOCKER_FILE_DIR} 

echo "prep any files with local configurations"
if ls __* 1> /dev/null 2>&1; then    
   IP_DOCKER0=`ifconfig docker0 |grep "inet addr" | cut -d: -f2 |cut -d" " -f1`
   TEMPLATES=`ls -1 __*`
   for TEMPLATE in $TEMPLATES
   do 
      FILENAME=${TEMPLATE//_}
      if [ ! -z ${IP_DOCKER0} ]; then
         sed -e "s/{{ ip.docker0 }}/${IP_DOCKER0}/" $TEMPLATE > $FILENAME
      fi
   done
fi

echo "starting docker operations"
#${DOCKER_EXE} login --username=${DOCKER_REGISTRY_USERNAME} --password=${DOCKER_REGISTRY_PASSWORD} ${DOCKER_REGISTRY}
${DOCKER_COMPOSE_EXE} up -d