comparison prod/install-workflows-db.sh @ 376:c6b2a1abecb8 release/v2.11.0

SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
author Marc Davis <davis@ssdt-ohio.org>
date Fri, 10 Sep 2021 07:44:49 -0400
parents
children 5909f75b4f13
comparison
equal deleted inserted replaced
375:c3e22e61d5a1 376:c6b2a1abecb8
1 #!/bin/bash
2 #
3 # read required env variables
4 BASEDIR="$PWD"
5 source $BASEDIR/.env/ssdt-workflows-shared.properties
6 source $BASEDIR/.env/ssdt-workflows-db.properties
7 #
8 # docker login
9 echo "Attempting to login to $artifactUrl"
10 docker login $artifactUrl -u $artifactUser -p $artifactPassword
11 # docker pull db image
12 echo "Attempting to pull $artifactUrl/ssdt-workflows-$dbVersion"
13 docker pull $artifactUrl/ssdt-workflows-db:$dbVersion
14 #
15 # Create workflows specific docker network for $entityId
16 echo "Attempting to create $entityId-workflows-net docker network"
17 docker network create $entityId-workflows-net
18 #docker run workflows-db (data mounted as volume) connected to $entityId-workflows-net docker network
19 echo "Attempting to execute docker run command"
20 docker run --name $entityId-workflows-db \
21 --restart=unless-stopped \
22 --mount source=$entityId-workflows-db,target=/var/lib/postgresql/data \
23 --network $entityId-workflows-net \
24 -e POSTGRES_DB=workflowsdb \
25 -e POSTGRES_PASSWORD=$dbPassword \
26 -d $artifactUrl/ssdt-workflows-db:$dbVersion