view prod/install-ipdp-db.sh @ 610:eac0afd727a8 tip

DS-56 Merge
author calmes@ssdt-ohio.org
date Wed, 02 Jul 2025 13:27:07 +0100
parents 2aebef3e31bf
children
line wrap: on
line source
#!/bin/bash
#
# read required env variables
BASEDIR="$PWD"
source $BASEDIR/.env/ipdp-shared.properties
source $BASEDIR/.env/ipdp-db.properties
#
# docker login
echo "attempting to login to $artifactoryUrl"
docker login $artifactoryUrl -u $artifactoryUser -p $artifactoryPassword
# docker pull db image
echo "attempting to pull $artifactoryUrl/ipdp-db:$dbVersion"
docker pull $artifactoryUrl/ipdp-db:$dbVersion
#
# create employee self service specific docker network for $entityId
echo "attempting to create $entityId-ipdp-net docker network"
docker network create $entityId-ipdp-net
# docker run ipdp-db (data mounted as volume) connected to $entityId-ipdp-net docker network
echo "attempting to execute docker run command"
docker run --name $entityId-ipdp-db \
           --restart=unlipdp-stopped \
           --mount source=$entityId-ipdp-db,target=/var/lib/postgresql/data \
           --network $entityId-ipdp-net \
           -e POSTGRES_DB=ipdpdb \
           -e POSTGRES_PASSWORD=$dbPassword \
           -d $artifactUrl/ipdp-db:$dbVersion