Mercurial > public > ssdt-docker
view prod/install-inventory-db.sh @ 586:f897ce55c610 production v2.19.0
flow: Merged <release> '2.19.0' to <master> ('production').
author | Marc Davis <marc.davis@mcoecn.org> |
---|---|
date | Thu, 05 Sep 2024 14:09:51 -0400 |
parents | cf7166c5c52f |
children |
line wrap: on
line source
#!/bin/bash # # read required env variables BASEDIR="$PWD" source $BASEDIR/.env/ssdt-inventory-shared.properties source $BASEDIR/.env/ssdt-inventory-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/inventory-db:$dbVersion" docker pull $artifactUrl/inventory-db:$dbVersion # # Create inventory specific docker network for $entityId echo "Attempting to create $entityId-inventory-net docker network" docker network create $entityId-inventory-net # docker run inventory-db (data mounted as volume) connected to $entityId-inventory-net docker network echo "Attempting to execute docker run command" docker run --name $entityId-inventory-db --restart=unless-stopped --mount source=$entityId-inventory-db,target=/var/lib/postgresql/data --network $entityId-inventory-net -e POSTGRES_DB=invdb -e POSTGRES_PASSWORD=$dbPassword -d $artifactUrl/inventory-db:$dbVersion