comparison prod/install-ess-db.sh @ 519:cb672d0888c6

add install script for ess database
author davis@ssdt-ohio.org
date Wed, 08 Nov 2023 09:49:17 -0500
parents
children cb688221b17b
comparison
equal deleted inserted replaced
518:ff7f693d873a 519:cb672d0888c6
1 #!/bin/bash
2 #
3 # read required env variables
4 BASEDIR="$PWD"
5 source $BASEDIR/.env/ess-shared.properties
6 source $BASEDIR/.env/ess-db.properties
7 #
8 # docker login
9 echo "attempting to login to $artifactoryUrl"
10 docker login $artifactoryUrl -u $artifactoryUser -p $artifactoryPassword
11 # docker pull db image
12 echo "attempting to pull $artifactoryUrl/ess-db:$dbVersion"
13 docker pull $artifactoryUrl/ess-db:$dbVersion
14 #
15 # create employee self service specific docker network for $entityId
16 echo "attempting to create $entityId-ess-net docker network"
17 docker network create $entityId-ess-net
18 # docker run ess-db (data mounted as volume) connected to $entityId-ess-net docker network
19 echo "attempting to execute docker run command"
20 docker run --name $entityId-ess-db \
21 --restart=unless-stopped \
22 --mount source=$entityId-ess-db,target=/var/lib/postgresql/data \
23 --network $entityId-ess-net \
24 -e POSTGRES_DB=essdb \
25 -e POSTGRES_PASSWORD=$dbPassword \
26 -d $artifactUrl/ess-db:$dbVersion