Mercurial > public > ssdt-docker
comparison prod/install-ipdp.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 |
comparison
equal
deleted
inserted
replaced
537:ad36483ba0c2 | 606:2aebef3e31bf |
---|---|
1 #!/bin/bash | |
2 # | |
3 # Copyright (c) 2025. Ohio Department of Education. - All Rights Reserved. | |
4 # Unauthorized copying of this file, in any medium, is strictly prohibited. | |
5 # Written by the State Software Development Team (http://ssdt.oecn.k12.oh.us/) | |
6 # | |
7 # | |
8 | |
9 # | |
10 # read required env variables | |
11 BASEDIR="$PWD" | |
12 source $BASEDIR/.env/ipdp-shared.properties | |
13 source $BASEDIR/.env/ipdp-app.properties | |
14 # docker login | |
15 echo "Attempting to login to $artifactUrl" | |
16 docker login $artifactUrl -u $artifactUser -p $artifactPassword | |
17 # docker pull db image | |
18 echo "Attempting to pull $artifactUrl/ipdp-app:$appVersion" | |
19 docker pull $artifactUrl/ipdp-app:$appVersion | |
20 # | |
21 # Builder docker run command based on settings in env files | |
22 echo "Building docker run command" | |
23 dockerRunCommand="docker run --name $entityId-ipdp-app | |
24 --restart=unlipdp-stopped | |
25 --network $entityId-ipdp-net | |
26 -e SPRING_DATASOURCE_URL=jdbc:postgresql://$entityId-ipdp-db:5432/ipdpdb | |
27 -e SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver | |
28 -e SPRING_DATASOURCE_USERNAME=postgres | |
29 -e SPRING_DATASOURCE_PASSWORD=$dbPassword | |
30 -e SPRING_PROFILES_ACTIVE=prod | |
31 -e APPLICATION_ADMIN_PASSWORD=$adminPassword | |
32 -e APPLICATION_ADMIN_RESET=$resetAdminPassword | |
33 -e USPS_CONFIGURATION_HOST=$uspsHost | |
34 -e USPS_CONFIGURATION_PORT=$uspsPort | |
35 -e USPS_CONFIGURATION_APIKEY=$uspsApiKey | |
36 -e USPS_CONFIGURATION_REMOTEAPIKEY=$uspsRemoteApiKey | |
37 -e USPS_CONFIGURATION_CONTEXT=$uspsContext | |
38 -e JAVA_OPTS=$java_opts" | |
39 # | |
40 if [ ! -z "$virtualHost" ]; then | |
41 dockerRunCommand="$dockerRunCommand -e VIRTUAL_HOST=$virtualHost" | |
42 fi | |
43 # | |
44 if [ ! -z "$virtualPort" ]; then | |
45 dockerRunCommand="$dockerRunCommand -e VIRTUAL_PORT=$virtualPort" | |
46 fi | |
47 # | |
48 if [ ! -z "$letsencryptHost" ]; then | |
49 dockerRunCommand="$dockerRunCommand -e LETSENCRYPT_HOST=$letsencryptHost" | |
50 fi | |
51 # | |
52 if [ ! -z "$letsencryptEmail" ]; then | |
53 dockerRunCommand="$dockerRunCommand -e LETSENCRYPT_EMAIL=$letsencryptEmail" | |
54 fi | |
55 # | |
56 if [ ! -z "$hostPort" ]; then | |
57 dockerRunCommand="$dockerRunCommand -p $hostPort" | |
58 fi | |
59 # | |
60 dockerRunCommand="$dockerRunCommand -d $artifactUrl/ipdp-app:$appVersion" | |
61 # | |
62 # Execute constructed docker run command to create $entityId-ipdp-app container connected to db and docker network | |
63 echo "Executing docker run command" | |
64 $dockerRunCommand |