Mercurial > public > ssdt-docker
comparison prod/install-workflows-app.sh @ 377:c1e8c755bce2 production
flow: Promoted <release> 'v2.11.0' (c6b2a1abecb8) to 'production'.
author | Marc Davis <davis@ssdt-ohio.org> |
---|---|
date | Fri, 10 Sep 2021 07:47:54 -0400 |
parents | c6b2a1abecb8 |
children | 5909f75b4f13 |
comparison
equal
deleted
inserted
replaced
372:173b41c77349 | 377:c1e8c755bce2 |
---|---|
1 #!/bin/bash | |
2 # | |
3 # read required env variables | |
4 BASEDIR="$PWD" | |
5 source $BASEDIR/.env/ssdt-workflows-shared.properties | |
6 source $BASEDIR/.env/ssdt-workflows-app.properties | |
7 # docker login | |
8 echo "Attempting to login to $artifactUrl" | |
9 docker login $artifactUrl -u $artifactUser -p $artifactPassword | |
10 # docker pull db image | |
11 echo "Attempting to pull $artifactUrl/ssdt-workflows-app:$appVersion" | |
12 docker pull $artifactUrl/ssdt-workflows-app:$appVersion | |
13 # | |
14 # Builder docker run command based on settings in env files | |
15 echo "Building docker run command" | |
16 dockerRunCommand="docker run --name $entityId-workflows-app | |
17 --restart=unless-stopped | |
18 --network $entityId-workflows-net | |
19 -e SPRING_DATASOURCE_URL=jdbc:postgresql://$entityId-workflows-db:5432/workflowsdb | |
20 -e SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver | |
21 -e SPRING_DATASOURCE_USERNAME=postgres | |
22 -e SPRING_DATASOURCE_PASSWORD=$dbPassword | |
23 -e SPRING_PROFILES_ACTIVE=prod | |
24 -e CAMUNDA_BPM_ADMINUSER_ID=admin | |
25 -e CAMUNDA_BPM_ADMINUSER_PASSWORD=$adminPassword | |
26 -e USAS_CONFIGURATION_HOST=$usasHost | |
27 -e USAS_CONFIGURATION_PORT=$usasPort | |
28 -e USAS_CONFIGURATION_APIKEY=$usasApiKey | |
29 -e USAS_CONFIGURATION_REMOTEAPIKEY=$usasRemoteApiKey | |
30 -e USPS_CONFIGURATION_HOST=$uspsHost | |
31 -e USPS_CONFIGURATION_PORT=$uspsPort | |
32 -e USPS_CONFIGURATION_APIKEY=$uspsApiKey | |
33 -e USPS_CONFIGURATION_REMOTEAPIKEY=$uspsRemoteApiKey | |
34 -e JAVA_OPTS=$java_opts" | |
35 # | |
36 if [ ! -z "$usasContext" ]; then | |
37 dockerRunCommand="$dockerRunCommand -e USAS_CONFIGURATION_CONTEXT=$usasContext" | |
38 fi | |
39 # | |
40 if [ ! -z "$uspsContext" ]; then | |
41 dockerRunCommand="$dockerRunCommand -e USPS_CONFIGURATION_CONTEXT=$uspsContext" | |
42 fi | |
43 # | |
44 if [ ! -z "$virtualHost" ]; then | |
45 dockerRunCommand="$dockerRunCommand -e VIRTUAL_HOST=$virtualHost" | |
46 fi | |
47 # | |
48 if [ ! -z "$virtualPort" ]; then | |
49 dockerRunCommand="$dockerRunCommand -e VIRTUAL_PORT=$virtualPort" | |
50 fi | |
51 # | |
52 if [ ! -z "$letsencryptHost" ]; then | |
53 dockerRunCommand="$dockerRunCommand -e LETSENCRYPT_HOST=$letsencryptHost" | |
54 fi | |
55 # | |
56 if [ ! -z "$letsencryptEmail" ]; then | |
57 dockerRunCommand="$dockerRunCommand -e LETSENCRYPT_EMAIL=$letsencryptEmail" | |
58 fi | |
59 # | |
60 if [ ! -z "$hostPort" ]; then | |
61 dockerRunCommand="$dockerRunCommand -p $hostPort" | |
62 fi | |
63 # | |
64 dockerRunCommand="$dockerRunCommand -d $artifactUrl/ssdt-workflows-app:$appVersion" | |
65 # | |
66 # Execute constructed docker run command to create $entityId-workflows-app container connected to db and docker network | |
67 echo "Executing docker run command" | |
68 $dockerRunCommand |