annotate 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
rev   line source
376
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
1 #!/bin/bash
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
2 #
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
3 # read required env variables
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
4 BASEDIR="$PWD"
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
5 source $BASEDIR/.env/ssdt-workflows-shared.properties
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
6 source $BASEDIR/.env/ssdt-workflows-db.properties
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
7 #
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
8 # docker login
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
9 echo "Attempting to login to $artifactUrl"
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
10 docker login $artifactUrl -u $artifactUser -p $artifactPassword
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
11 # docker pull db image
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
12 echo "Attempting to pull $artifactUrl/ssdt-workflows-$dbVersion"
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
13 docker pull $artifactUrl/ssdt-workflows-db:$dbVersion
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
14 #
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
15 # Create workflows specific docker network for $entityId
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
16 echo "Attempting to create $entityId-workflows-net docker network"
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
17 docker network create $entityId-workflows-net
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
18 #docker run workflows-db (data mounted as volume) connected to $entityId-workflows-net docker network
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
19 echo "Attempting to execute docker run command"
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
20 docker run --name $entityId-workflows-db \
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
21 --restart=unless-stopped \
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
22 --mount source=$entityId-workflows-db,target=/var/lib/postgresql/data \
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
23 --network $entityId-workflows-net \
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
24 -e POSTGRES_DB=workflowsdb \
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
25 -e POSTGRES_PASSWORD=$dbPassword \
c6b2a1abecb8 SW-262: Move install-workflows-db.sh and install-workflows-app.sh to ssdt-docker project
Marc Davis <davis@ssdt-ohio.org>
parents:
diff changeset
26 -d $artifactUrl/ssdt-workflows-db:$dbVersion