changeset 135:03e39b95d904

DEP-12: convert to compose verison 3.1 (again)
author smith@nwoca.org
date Mon, 15 May 2017 21:33:24 +0100
parents 48c5b742016c
children 72f15ffc9ad2
files compose2/preview/import-usas.yml compose2/preview/import-usps.yml compose2/preview/setup.sh compose2/preview/training.yml compose2/preview/usxs-services.yml compose2/preview/usxs-template.yml compose3/preview/import-usas.yml compose3/preview/import-usps.yml compose3/preview/setup.sh compose3/preview/training.yml compose3/preview/usxs-services.yml compose3/preview/usxs-template.yml
diffstat 12 files changed, 236 insertions(+), 214 deletions(-) [+]
line wrap: on
line diff
--- a/compose2/preview/import-usas.yml	Mon May 08 22:41:49 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-version: "2.1"
-services:
-  usasimport:
-    extends:
-     file: /ssdt/compose2/preview/usxs-services.yml
-     service: usasimport-base
--- a/compose2/preview/import-usps.yml	Mon May 08 22:41:49 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-version: "2.1"
-services:
-  uspsimport:
-    extends:
-     file: /ssdt/compose2/preview/usxs-services.yml
-     service: uspsimport-base
--- a/compose2/preview/setup.sh	Mon May 08 22:41:49 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-#!/bin/bash
-# Sets up a new district project based on SSDT default configuration in the current working directory.
-#
-# Usage:
-#
-#  /data/preview/sampletown $   /ssdt/compose2/preview/setup.sh
-#
-# Will create a docker-compose.yml and .env file with default settings.
-#
-# 
-source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/.functions.sh"
-
-base=$(dirname "${BASH_SOURCE[0]}")
-default_name=$(basename $PWD)
-
-echo "Preparing '$(basename $PWD)' with default USxS configuration" 
-
-touch .env
-source .env
-
-if [ "$COMPOSE_PROJECT_NAME" == "" ]
-then
-   read -e -p "Enter project name: <${default_name}> " answer
-   project_name=${answer:-$default_name}
-   echo "COMPOSE_PROJECT_NAME=${project_name}" >> .env
-   echo "set project name in .env file"
-   source .env
-fi
-
-if [ ! -e "docker-compose.yml" ] ; then
-    cp $base/usxs-template.yml ./docker-compose.yml
-    echo "created default docker-compose.yml"
-fi
-
-if [ "$USAS_APPLICATIONID" == "" ]
-then
-   read -e -p "Generate USAS and USPS integration config? <Y/n> " answer
-   case $answer in
-        y | Y | yes | YES ) answer="y";;
-        n | N | no | NO ) answer="n";;
-        *) answer="y"
-   esac
-   if [ "$answer" == "y" ] 
-   then
-     usas_id=${COMPOSE_PROJECT_NAME}-usas
-     usas_key=$(openssl rand -hex 32)
-     usps_id=${COMPOSE_PROJECT_NAME}-usps
-     usps_key=$(openssl rand -hex 32)
-     echo "USAS_APPLICATIONID=${usas_id}"   >> .env
-     echo "USAS_APIKEY=$usas_key"           >> .env
-     echo "USPS_APPLICATIONID=${usps_id}"   >> .env
-     echo "USPS_APIKEY=$usps_key"           >> .env
-     echo "Created integration API keys.  Enable integration modules after applications startup"
-   fi
-fi
-
-echo "project '$COMPOSE_PROJECT_NAME' ready with default values.  Review or create a docker-compose.override.yml for custom settings."
-
--- a/compose2/preview/training.yml	Mon May 08 22:41:49 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-usasdb:
-  restart: unless-stopped
-  image: docker.ssdt.io/trainingdb-usas
-  environment:
-    - DB_NAME=usasdb
-    - DB_USER=usas
-    - DB_PASS=usasdefault
-usasapp:
-  restart: unless-stopped
-  image: docker.ssdt.io/usas-app:preview
-  volumes:
-    - ${PWD}/config:/config
-  environment:
-    - DB_HOST=usas-database
-    - DB_NAME=usasdb
-    - DB_USER=usas
-    - DB_PASS=usasdefault
-    - JAVA_OPTS=-Xmx640m
-  links:
-    - usasdb:usas-database
-uspsdb:
-  restart: unless-stopped
-  image: docker.ssdt.io/trainingdb-usps
-  environment:
-    - DB_NAME=uspsdb
-    - DB_USER=usps
-    - DB_PASS=uspsdefault
-uspsapp:
-  restart: unless-stopped
-  image: docker.ssdt.io/usps-app:preview
-  volumes:
-    - ${PWD}/config:/config
-  environment:
-    - DB_HOST=usps-database
-    - DB_NAME=uspsdb
-    - DB_USER=usps
-    - DB_PASS=uspsdefault
-    - JAVA_OPTS=-Xmx640m
-  links:
-    - uspsdb:usps-database
-
--- a/compose2/preview/usxs-services.yml	Mon May 08 22:41:49 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-# base compose file for USxS Preview releases
-version: "2.1"
-services:
-  usasdb-base:
-    restart: unless-stopped
-    image: docker.ssdt.io/ssdt-postgres:4
-    volumes:
-      - usasdata:/var/lib/postgresql/data
-    networks:
-      - default
-    environment:
-      - DB_NAME=usasdb
-      - DB_USER=usas
-      - DB_PASS=${USAS_DB_PASSWORD:-usasdefault}
-  usasapp-base:
-    restart: unless-stopped
-    image: docker.ssdt.io/usas-app:preview
-    networks:
-      - default
-    environment:
-      - DB_HOST=usasdb
-      - DB_NAME=usasdb
-      - DB_USER=usas
-      - DB_PASS=${USAS_DB_PASSWORD:-usasdefault}
-      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_CLIENTHOST=uspsapp
-      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_CLIENTDNSLOOKUP=true
-      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_SERVERHOST=0.0.0.0
-      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_SERVERHOSTDNSLOOKUP=false
-      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_APPLICATIONID=${USAS_APPLICATIONID:- }
-      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_APIKEY=${USAS_APIKEY:- }
-      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_REMOTEAPPLICATIONID=${USPS_APPLICATIONID:- }
-      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_REMOTEAPIKEY=${USPS_APIKEY:- }
-  usasimport-base:
-    image: docker.ssdt.io/usas-import:preview
-    command: -i ${IMP_IRN- } -u ${IMP_URL- } -r ${IMP_PATH- }
-    environment:
-      - DB_HOST=usasdb
-      - DB_NAME=usasdb
-      - DB_USER=usas
-      - DB_PASS=${USAS_DB_PASSWORD:-usasdefault}
-  uspsdb-base:
-    restart: unless-stopped
-    image: docker.ssdt.io/ssdt-postgres:4
-    volumes:
-      - uspsdata:/var/lib/postgresql/data
-    networks:
-      - default
-    environment:
-      - DB_NAME=uspsdb
-      - DB_USER=usps
-      - DB_PASS=${USPS_DB_PASSWORD:-uspsdefault}
-  uspsapp-base:
-    restart: unless-stopped
-    image: docker.ssdt.io/usps-app:preview
-    networks:
-      - default
-    environment:
-      - DB_HOST=uspsdb
-      - DB_NAME=uspsdb
-      - DB_USER=usps
-      - DB_PASS=${USPS_DB_PASSWORD:-uspsdefault}
-      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_CLIENTHOST=usasapp
-      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_CLIENTDNSLOOKUP=true
-      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_SERVERHOST=0.0.0.0
-      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_SERVERHOSTDNSLOOKUP=false
-      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_APPLICATIONID=${USPS_APPLICATIONID:- }
-      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_APIKEY=${USPS_APIKEY:- }
-      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_REMOTEAPPLICATIONID=${USAS_APPLICATIONID:- }
-      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_REMOTEAPIKEY=${USAS_APIKEY:- }
-  uspsimport-base:
-    image: docker.ssdt.io/usps-import:preview
-    command: -i ${IMP_IRN- } -u ${IMP_URL- } -r ${IMP_PATH- } ${IMP_ANON- } ${IMP_EM- }
-    environment:
-      - DB_HOST=uspsdb
-      - DB_NAME=uspsdb
-      - DB_USER=usps
-      - DB_PASS=${USPS_DB_PASSWORD:-uspsdefault}
-      
\ No newline at end of file
--- a/compose2/preview/usxs-template.yml	Mon May 08 22:41:49 2017 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-version: "2.1"
-services:
-  usasdb:
-    extends:
-      file: /ssdt/compose2/preview/usxs-services.yml
-      service: usasdb-base
-  usasapp:
-    extends:
-       file: /ssdt/compose2/preview/usxs-services.yml
-       service: usasapp-base
-    depends_on:
-      - usasdb
-  uspsdb:
-    extends:
-      file: /ssdt/compose2/preview/usxs-services.yml
-      service: uspsdb-base
-  uspsapp:
-    extends:
-       file: /ssdt/compose2/preview/usxs-services.yml
-       service: uspsapp-base
-    depends_on:
-      - uspsdb
-volumes:
-  usasdata:
-  uspsdata:
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compose3/preview/import-usas.yml	Mon May 15 21:33:24 2017 +0100
@@ -0,0 +1,6 @@
+version: "3.1"
+services:
+  usasimport:
+    extends:
+     file: /ssdt/compose2/preview/usxs-services.yml
+     service: usasimport-base
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compose3/preview/import-usps.yml	Mon May 15 21:33:24 2017 +0100
@@ -0,0 +1,6 @@
+version: "3.1"
+services:
+  uspsimport:
+    extends:
+     file: /ssdt/compose2/preview/usxs-services.yml
+     service: uspsimport-base
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compose3/preview/setup.sh	Mon May 15 21:33:24 2017 +0100
@@ -0,0 +1,80 @@
+#!/bin/bash
+# Sets up a new district project based on SSDT default configuration in the current working directory.
+#
+# Usage:
+#
+#  /data/preview/sampletown $   /ssdt/compose2/preview/setup.sh [usas,usps...] 
+#
+# 
+#
+# Will create a docker-compose.yml and .env file with default settings.
+#
+# 
+source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/.functions.sh"
+
+base=$(dirname "${BASH_SOURCE[0]}")
+default_name=$(basename $PWD)
+
+args="$1$2"
+
+usas=0
+usps=0
+
+if [ "$args" == "" ] || [ -z "${args##*usas*}" ]
+then
+   usas=1
+fi
+
+if [ "$args" == "" ] || [ -z "${args##*usps*}" ]
+then
+   usps=1
+fi
+
+echo "args: $args usas: $usas usps: $usps"
+
+exit 
+
+
+echo "Preparing '$(basename $PWD)' with default USxS configuration" 
+
+touch .env
+source .env
+
+if [ "$COMPOSE_PROJECT_NAME" == "" ]
+then
+   read -e -p "Enter project name: <${default_name}> " answer
+   project_name=${answer:-$default_name}
+   echo "COMPOSE_PROJECT_NAME=${project_name}" >> .env
+   echo "set project name in .env file"
+   source .env
+fi
+
+if [ ! -e "docker-compose.yml" ] ; then
+    cp $base/usxs-template.yml ./docker-compose.yml
+    echo "created default docker-compose.yml"
+fi
+
+if [ "$USAS_APPLICATIONID" == "" ]
+then
+   read -e -p "Generate USAS and USPS integration config? <Y/n> " answer
+   case $answer in
+        y | Y | yes | YES ) answer="y";;
+        n | N | no | NO ) answer="n";;
+        *) answer="y"
+   esac
+   if [ "$answer" == "y" ] 
+   then
+     usas_id=${COMPOSE_PROJECT_NAME}-usas
+     usas_key=$(openssl rand -hex 32)
+     usps_id=${COMPOSE_PROJECT_NAME}-usps
+     usps_key=$(openssl rand -hex 32)
+     echo "USAS_APPLICATIONID=${usas_id}"   >> .env
+     echo "USAS_APIKEY=$usas_key"           >> .env
+     echo "USPS_APPLICATIONID=${usps_id}"   >> .env
+     echo "USPS_APIKEY=$usps_key"           >> .env
+     echo "Created integration API keys.  Enable integration modules after applications startup"
+   fi
+fi
+
+echo "project '$COMPOSE_PROJECT_NAME' ready with default values.  Review or create a docker-compose.override.yml for custom settings."
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compose3/preview/training.yml	Mon May 15 21:33:24 2017 +0100
@@ -0,0 +1,41 @@
+usasdb:
+  restart: unless-stopped
+  image: docker.ssdt.io/trainingdb-usas
+  environment:
+    - DB_NAME=usasdb
+    - DB_USER=usas
+    - DB_PASS=usasdefault
+usasapp:
+  restart: unless-stopped
+  image: docker.ssdt.io/usas-app:preview
+  volumes:
+    - ${PWD}/config:/config
+  environment:
+    - DB_HOST=usas-database
+    - DB_NAME=usasdb
+    - DB_USER=usas
+    - DB_PASS=usasdefault
+    - JAVA_OPTS=-Xmx640m
+  links:
+    - usasdb:usas-database
+uspsdb:
+  restart: unless-stopped
+  image: docker.ssdt.io/trainingdb-usps
+  environment:
+    - DB_NAME=uspsdb
+    - DB_USER=usps
+    - DB_PASS=uspsdefault
+uspsapp:
+  restart: unless-stopped
+  image: docker.ssdt.io/usps-app:preview
+  volumes:
+    - ${PWD}/config:/config
+  environment:
+    - DB_HOST=usps-database
+    - DB_NAME=uspsdb
+    - DB_USER=usps
+    - DB_PASS=uspsdefault
+    - JAVA_OPTS=-Xmx640m
+  links:
+    - uspsdb:usps-database
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compose3/preview/usxs-services.yml	Mon May 15 21:33:24 2017 +0100
@@ -0,0 +1,78 @@
+# base compose file for USxS Preview releases
+version: "3.1"
+services:
+  usasdb-base:
+    restart: unless-stopped
+    image: docker.ssdt.io/ssdt-postgres:4
+    volumes:
+      - usasdata:/var/lib/postgresql/data
+    networks:
+      - default
+    environment:
+      - DB_NAME=usasdb
+      - DB_USER=usas
+      - DB_PASS=${USAS_DB_PASSWORD:-usasdefault}
+  usasapp-base:
+    restart: unless-stopped
+    image: docker.ssdt.io/usas-app:preview
+    networks:
+      - default
+    environment:
+      - DB_HOST=usasdb
+      - DB_NAME=usasdb
+      - DB_USER=usas
+      - DB_PASS=${USAS_DB_PASSWORD:-usasdefault}
+      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_CLIENTHOST=uspsapp
+      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_CLIENTDNSLOOKUP=true
+      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_SERVERHOST=0.0.0.0
+      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_SERVERHOSTDNSLOOKUP=false
+      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_APPLICATIONID=${USAS_APPLICATIONID:- }
+      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_APIKEY=${USAS_APIKEY:- }
+      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_REMOTEAPPLICATIONID=${USPS_APPLICATIONID:- }
+      - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_REMOTEAPIKEY=${USPS_APIKEY:- }
+  usasimport-base:
+    image: docker.ssdt.io/usas-import:preview
+    command: -i ${IMP_IRN- } -u ${IMP_URL- } -r ${IMP_PATH- }
+    environment:
+      - DB_HOST=usasdb
+      - DB_NAME=usasdb
+      - DB_USER=usas
+      - DB_PASS=${USAS_DB_PASSWORD:-usasdefault}
+  uspsdb-base:
+    restart: unless-stopped
+    image: docker.ssdt.io/ssdt-postgres:4
+    volumes:
+      - uspsdata:/var/lib/postgresql/data
+    networks:
+      - default
+    environment:
+      - DB_NAME=uspsdb
+      - DB_USER=usps
+      - DB_PASS=${USPS_DB_PASSWORD:-uspsdefault}
+  uspsapp-base:
+    restart: unless-stopped
+    image: docker.ssdt.io/usps-app:preview
+    networks:
+      - default
+    environment:
+      - DB_HOST=uspsdb
+      - DB_NAME=uspsdb
+      - DB_USER=usps
+      - DB_PASS=${USPS_DB_PASSWORD:-uspsdefault}
+      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_CLIENTHOST=usasapp
+      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_CLIENTDNSLOOKUP=true
+      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_SERVERHOST=0.0.0.0
+      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_SERVERHOSTDNSLOOKUP=false
+      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_APPLICATIONID=${USPS_APPLICATIONID:- }
+      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_APIKEY=${USPS_APIKEY:- }
+      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_REMOTEAPPLICATIONID=${USAS_APPLICATIONID:- }
+      - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_REMOTEAPIKEY=${USAS_APIKEY:- }
+  uspsimport-base:
+    image: docker.ssdt.io/usps-import:preview
+    command: -i ${IMP_IRN- } -u ${IMP_URL- } -r ${IMP_PATH- } ${IMP_ANON- } ${IMP_EM- }
+    environment:
+      - DB_HOST=uspsdb
+      - DB_NAME=uspsdb
+      - DB_USER=usps
+      - DB_PASS=${USPS_DB_PASSWORD:-uspsdefault}
+      
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compose3/preview/usxs-template.yml	Mon May 15 21:33:24 2017 +0100
@@ -0,0 +1,25 @@
+version: "3.1"
+services:
+  usasdb:
+    extends:
+      file: /ssdt/compose2/preview/usxs-services.yml
+      service: usasdb-base
+  usasapp:
+    extends:
+       file: /ssdt/compose2/preview/usxs-services.yml
+       service: usasapp-base
+    depends_on:
+      - usasdb
+  uspsdb:
+    extends:
+      file: /ssdt/compose2/preview/usxs-services.yml
+      service: uspsdb-base
+  uspsapp:
+    extends:
+       file: /ssdt/compose2/preview/usxs-services.yml
+       service: uspsapp-base
+    depends_on:
+      - uspsdb
+volumes:
+  usasdata:
+  uspsdata:
\ No newline at end of file