diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/prod/install-workflows-db.sh	Fri Sep 10 07:44:49 2021 -0400
@@ -0,0 +1,26 @@
+#!/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