comparison prod/import-inventory.sh @ 363:cf7166c5c52f

INV-196 Move inventory scripts to prod directory
author Matt Calmes <calmes@ssdt-ohio.org>
date Mon, 16 Aug 2021 12:58:30 -0400
parents
children
comparison
equal deleted inserted replaced
362:91d530304bbf 363:cf7166c5c52f
1 #!/bin/bash
2 #
3 BASEDIR="$PWD"
4 # read required environment variables
5 source $BASEDIR/.env/ssdt-inventory-shared.properties
6 source $BASEDIR/.env/ssdt-inventory-import.properties
7 #
8 # docker login
9 echo "Attempting to login to $artifactUrl"
10 docker login $artifactUrl -u $artifactUser -p $artifactPassword
11 # docker pull
12 echo "Attempting to pull $artifactUrl/inventory-importapp:$importVersion"
13 docker pull $artifactUrl/inventory-importapp:$importVersion
14 #
15 echo "Building docker run command"
16 dockerParams="--rm --name $entityId-inventory-importapp -v $importPath:/extracts --network $entityId-inventory-net"
17 dockerParams="$dockerParams -e SPRING_DATASOURCE_URL=jdbc:postgresql://$entityId-inventory-db:5432/invdb -e SPRING_DATASOURCE_PASSWORD=$dbPassword"
18 dockerParams="$dockerParams -e SPRING_PROFILES_ACTIVE=prod -e APPLICATION_ADMIN_PASSWORD=$adminPassword -i $artifactUrl/inventory-importapp:$importVersion"
19 echo "Executing docker run command"
20 docker run $dockerParams