annotate prod/install-workflows-app.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-app.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 # 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
8 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
9 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
10 # 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
11 echo "Attempting to pull $artifactUrl/ssdt-workflows-app:$appVersion"
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 docker pull $artifactUrl/ssdt-workflows-app:$appVersion
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 #
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 # Builder docker run command based on settings in env files
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 echo "Building 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
16 dockerRunCommand="docker run --name $entityId-workflows-app
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 --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
18 --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
19 -e SPRING_DATASOURCE_URL=jdbc:postgresql://$entityId-workflows-db:5432/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
20 -e SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver
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 -e SPRING_DATASOURCE_USERNAME=postgres
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 -e SPRING_DATASOURCE_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
23 -e SPRING_PROFILES_ACTIVE=prod
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 CAMUNDA_BPM_ADMINUSER_ID=admin
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 CAMUNDA_BPM_ADMINUSER_PASSWORD=$adminPassword
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 -e USAS_CONFIGURATION_HOST=$usasHost
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
27 -e USAS_CONFIGURATION_PORT=$usasPort
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
28 -e USAS_CONFIGURATION_APIKEY=$usasApiKey
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
29 -e USAS_CONFIGURATION_REMOTEAPIKEY=$usasRemoteApiKey
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
30 -e USPS_CONFIGURATION_HOST=$uspsHost
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
31 -e USPS_CONFIGURATION_PORT=$uspsPort
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
32 -e USPS_CONFIGURATION_APIKEY=$uspsApiKey
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
33 -e USPS_CONFIGURATION_REMOTEAPIKEY=$uspsRemoteApiKey
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
34 -e JAVA_OPTS=$java_opts"
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
35 #
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
36 if [ ! -z "$usasContext" ]; then
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
37 dockerRunCommand="$dockerRunCommand -e USAS_CONFIGURATION_CONTEXT=$usasContext"
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
38 fi
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
39 #
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
40 if [ ! -z "$uspsContext" ]; then
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
41 dockerRunCommand="$dockerRunCommand -e USPS_CONFIGURATION_CONTEXT=$uspsContext"
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
42 fi
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
43 #
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
44 if [ ! -z "$virtualHost" ]; then
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
45 dockerRunCommand="$dockerRunCommand -e VIRTUAL_HOST=$virtualHost"
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
46 fi
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
47 #
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
48 if [ ! -z "$virtualPort" ]; then
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
49 dockerRunCommand="$dockerRunCommand -e VIRTUAL_PORT=$virtualPort"
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
50 fi
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
51 #
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
52 if [ ! -z "$letsencryptHost" ]; then
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
53 dockerRunCommand="$dockerRunCommand -e LETSENCRYPT_HOST=$letsencryptHost"
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
54 fi
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
55 #
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
56 if [ ! -z "$letsencryptEmail" ]; then
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
57 dockerRunCommand="$dockerRunCommand -e LETSENCRYPT_EMAIL=$letsencryptEmail"
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
58 fi
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
59 #
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
60 if [ ! -z "$hostPort" ]; then
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
61 dockerRunCommand="$dockerRunCommand -p $hostPort"
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
62 fi
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
63 #
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
64 dockerRunCommand="$dockerRunCommand -d $artifactUrl/ssdt-workflows-app:$appVersion"
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
65 #
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
66 # Execute constructed docker run command to create $entityId-workflows-app container connected to db and 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
67 echo "Executing 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
68 $dockerRunCommand