diff prod/install-ipdp-db.sh @ 606:2aebef3e31bf

add ipdp install scripts
author Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
date Tue, 01 Jul 2025 20:50:56 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/prod/install-ipdp-db.sh	Tue Jul 01 20:50:56 2025 +0100
@@ -0,0 +1,26 @@
+#!/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
\ No newline at end of file