comparison prod/install-ess-app.sh @ 533:2e67cfae1533 production v2.17.0

flow: Merged <release> '2.17.0' to <master> ('production').
author Marc Davis <marc.davis@mcoecn.org>
date Thu, 02 May 2024 22:46:24 -0400
parents e483148f5283
children b6f03eb10850
comparison
equal deleted inserted replaced
524:6ddfd364a52a 533:2e67cfae1533
1 #!/bin/bash
2 #
3 # read required env variables
4 BASEDIR="$PWD"
5 source $BASEDIR/.env/ess-shared.properties
6 source $BASEDIR/.env/ess-app.properties
7 #
8 # docker login
9 echo "Attempting to login to $artifactUrl"
10 docker login $artifactUrl -u $artifactUser -p $artifactPassword
11 #
12 # docker pull app image
13 echo "Attempting to pull $artifactUrl/ess-app:$appVersion"
14 docker pull $artifactUrl/ess-app:$appVersion
15 #
16 # Builder docker run command based on settings in env files
17 echo "Building docker run command"
18 dockerRunCommand="docker run --name $entityId-ess-app
19 --restart=unless-stopped
20 --network $entityId-ess-net
21 -e SPRING_DATASOURCE_URL=jdbc:postgresql://$entityId-ess-db:5432/essdb
22 -e SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver
23 -e SPRING_DATASOURCE_USERNAME=postgres
24 -e SPRING_DATASOURCE_PASSWORD=$dbPassword
25 -e SPRING_PROFILES_ACTIVE=prod
26 -e APPLICATION_ADMIN_PASSWORD=$adminPassword
27 -e APPLICATION_ADMIN_RESET=$resetAdminPassword
28 -e USPS_CONFIGURATION_HOST=$uspsHost
29 -e USPS_CONFIGURATION_PORT=$uspsPort
30 -e USPS_CONFIGURATION_APIKEY=$uspsApiKey
31 -e USPS_CONFIGURATION_REMOTEAPIKEY=$uspsRemoteApiKey
32 -e WORKFLOWS_CONFIGURATION_HOST=$workflowsHost
33 -e WORKFLOWS_CONFIGURATION_PORT=$workflowsPort
34 -e WORKFLOWS_CONFIGURATION_API_KEY=$workflowsApiKey
35 -e WORKFLOWS_CONFIGURATION_REMOTE_API_KEY=$workflowsRemoteApiKey
36 -e JAVA_OPTS=$java_opts"
37 #
38 if [ ! -z "$virtualHost" ]; then
39 dockerRunCommand="$dockerRunCommand -e VIRTUAL_HOST=$virtualHost"
40 fi
41 #
42 if [ ! -z "$virtualPort" ]; then
43 dockerRunCommand="$dockerRunCommand -e VIRTUAL_PORT=$virtualPort"
44 fi
45 #
46 if [ ! -z "$letsencryptHost" ]; then
47 dockerRunCommand="$dockerRunCommand -e LETSENCRYPT_HOST=$letsencryptHost"
48 fi
49 #
50 if [ ! -z "$letsencryptEmail" ]; then
51 dockerRunCommand="$dockerRunCommand -e LETSENCRYPT_EMAIL=$letsencryptEmail"
52 fi
53 #
54 if [ ! -z "$hostPort" ]; then
55 dockerRunCommand="$dockerRunCommand -p $hostPort"
56 fi
57 #
58 #
59 if [ ! -z "$duoEnabled" ]; then
60 echo "Adding Duo Configuration"
61 dockerRunCommand="$dockerRunCommand
62 -e DUO_ENABLED=$duoEnabled
63 -e DUO_CLIENT_ID=$duoClientId
64 -e DUO_CLIENT_SECRET=$duoClientSecret
65 -e DUO_API_HOSTNAME=$duoApiHostname
66 -e DUO_FAIL_OPEN=$duoFailOpen
67 -e DUO_ESS_HOST=$duoEssHost
68 -e DUO_ESS_PORT=$duoEssPort
69 -e DUO_ESS_CONTEXT=$duoEssContext
70 -e DUO_MINUTES_UNTIL_EXPIRATION=$duoMinutesUntilExpiration"
71 fi
72 #
73 #
74 if [ ! -z "$ads_config1_enabled" ]; then
75 echo "Add Window Active Director Configuration 1"
76 dockerRunCommand="$dockerRunCommand
77 -e SSDT_ADS_CONFIG1_ENABLED=$ads_config1_enabled
78 -e SSDT_ADS_CONFIG1_DOMAIN=$ads_config1_domain
79 -e SSDT_ADS_CONFIG1_LDAP_URL=$ads_config1_ldap_url
80 -e SSDT_ADS_CONFIG1_ROOT_DN=$ads_config1_root_dn
81 -e SSDT_ADS_CONFIG1_SEARCH_FILTER=$ads_config1_search_filter"
82 fi
83 #
84 #
85 if [ ! -z "$ads_config2_enabled" ]; then
86 echo "Add Window Active Director Configuration 2"
87 dockerRunCommand="$dockerRunCommand
88 -e SSDT_ADS_CONFIG2_ENABLED=$ads_config2_enabled
89 -e SSDT_ADS_CONFIG2_DOMAIN=$ads_config2_domain
90 -e SSDT_ADS_CONFIG2_LDAP_URL=$ads_config2_ldap_url
91 -e SSDT_ADS_CONFIG2_ROOT_DN=$ads_config2_root_dn
92 -e SSDT_ADS_CONFIG2_SEARCH_FILTER=$ads_config2_search_filter"
93 fi
94 #
95 #
96 if [ ! -z "$ads_config3_enabled" ]; then
97 echo "Add Window Active Director Configuration 3"
98 dockerRunCommand="$dockerRunCommand
99 -e SSDT_ADS_CONFIG3_ENABLED=$ads_config3_enabled
100 -e SSDT_ADS_CONFIG3_DOMAIN=$ads_config3_domain
101 -e SSDT_ADS_CONFIG3_LDAP_URL=$ads_config3_ldap_url
102 -e SSDT_ADS_CONFIG3_ROOT_DN=$ads_config3_root_dn
103 -e SSDT_ADS_CONFIG3_SEARCH_FILTER=$ads_config3_search_filter"
104 fi
105 #
106 #
107 dockerRunCommand="$dockerRunCommand -d $artifactUrl/ess-app:$appVersion"
108 #
109 # Execute constructed docker run command to create $entityId-ess-app container connected to db and docker network
110 echo "Executing docker run command"
111 $dockerRunCommand