view prod/install-workflows-db.sh @ 605:46a67e7afd98 release/2.23.0 tip

flow: Created branch 'release/2.23.0'.
author Marc Davis <marc.davis@mcoecn.org>
date Wed, 18 Sep 2024 20:38:06 -0400
parents 5909f75b4f13
children
line wrap: on
line source
#!/bin/bash
#
# read required env variables
BASEDIR="$PWD"
source $BASEDIR/.env/ssdt-workflows-shared.properties
source $BASEDIR/.env/ssdt-workflows-db.properties
#
# docker login
echo "Attempting to login to $artifactUrl"
docker login $artifactUrl -u $artifactUser -p $artifactPassword
# docker pull db image
echo "Attempting to pull $artifactUrl/ssdt-workflows-$dbVersion"
docker pull $artifactUrl/ssdt-workflows-db:$dbVersion
#
# Create workflows specific docker network for $entityId
echo "Attempting to create $entityId-workflows-net docker network"
docker network create $entityId-workflows-net
#docker run workflows-db (data mounted as volume) connected to $entityId-workflows-net docker network
echo "Attempting to execute docker run command"
docker run --name $entityId-workflows-db \
           --restart=unless-stopped \
           --mount source=$entityId-workflows-db,target=/var/lib/postgresql/data \
           --network $entityId-workflows-net \
           -e POSTGRES_DB=workflowsdb \
           -e POSTGRES_PASSWORD=$dbPassword \
           -d $artifactUrl/ssdt-workflows-db:$dbVersion