Mercurial > public > ssdt-docker
comparison prod/install-itcm-db.sh @ 413:4b0c2c7e213b production v2.15.0
flow: Merged <release> '2.15.0' to <master> ('production').
author | Marc Davis <marc.davis@mcoecn.org> |
---|---|
date | Fri, 14 Oct 2022 10:20:38 -0400 |
parents | e49038cbb14c |
children |
comparison
equal
deleted
inserted
replaced
407:cc2ef015d7e1 | 413:4b0c2c7e213b |
---|---|
1 #!/bin/bash | |
2 # | |
3 # read required env variables | |
4 BASEDIR="$PWD" | |
5 source $BASEDIR/.env/itcm-shared.properties | |
6 source $BASEDIR/.env/itcm-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/itcm-$dbVersion" | |
13 docker pull $artifactUrl/itcm-db:$dbVersion | |
14 # | |
15 # create itc management specific docker network for $entityId | |
16 echo "Attempting to create $entityId-itcm-net docker network" | |
17 docker network create $entityId-itcm-net | |
18 # docker run itcm-db (data mounted as volume) connected to $entityId-itcm-net docker network | |
19 echo "Attempting to execute docker run command" | |
20 docker run --name $entityId-itcm-db \ | |
21 --restart=unless-stopped \ | |
22 --mount source=$entityId-itcm-db,target=/var/lib/postgresql/data \ | |
23 --network $entityId-itcm-net \ | |
24 -e POSTGRES_DB=itcmdb \ | |
25 -e POSTGRES_PASSWORD=$dbPassword \ | |
26 -d $artifactUrl/itcm-db:$dbVersion |