Mercurial > public > ssdt-docker
annotate 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 |
rev | line source |
---|---|
606
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
1 #!/bin/bash |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
2 # |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
3 # read required env variables |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
4 BASEDIR="$PWD" |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
5 source $BASEDIR/.env/ipdp-shared.properties |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
6 source $BASEDIR/.env/ipdp-db.properties |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
7 # |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
8 # docker login |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
9 echo "attempting to login to $artifactoryUrl" |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
10 docker login $artifactoryUrl -u $artifactoryUser -p $artifactoryPassword |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
11 # docker pull db image |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
12 echo "attempting to pull $artifactoryUrl/ipdp-db:$dbVersion" |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
13 docker pull $artifactoryUrl/ipdp-db:$dbVersion |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
14 # |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
15 # create employee self service specific docker network for $entityId |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
16 echo "attempting to create $entityId-ipdp-net docker network" |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
17 docker network create $entityId-ipdp-net |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
18 # docker run ipdp-db (data mounted as volume) connected to $entityId-ipdp-net docker network |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
19 echo "attempting to execute docker run command" |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
20 docker run --name $entityId-ipdp-db \ |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
21 --restart=unlipdp-stopped \ |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
22 --mount source=$entityId-ipdp-db,target=/var/lib/postgresql/data \ |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
23 --network $entityId-ipdp-net \ |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
24 -e POSTGRES_DB=ipdpdb \ |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
25 -e POSTGRES_PASSWORD=$dbPassword \ |
2aebef3e31bf
add ipdp install scripts
Justin Kleinknecht <justin.kleinknecht@mcoecn.org>
parents:
diff
changeset
|
26 -d $artifactUrl/ipdp-db:$dbVersion |