changeset 367:50e99c5b33af production vv2.9.0

flow: Merged <release> 'v2.9.0' to <master> ('production').
author Jodi Becher <becher@ssdt-ohio.org>
date Mon, 16 Aug 2021 18:46:57 +0100
parents dab812f30d3e (current diff) 1ee4e9f19f13 (diff)
children d107f28b75eb
files testbench-grid/Dockerfile testbench-node/Dockerfile
diffstat 14 files changed, 185 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/prod/import-inventory.sh	Mon Aug 16 18:46:57 2021 +0100
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+BASEDIR="$PWD"
+# read required environment variables
+source $BASEDIR/.env/ssdt-inventory-shared.properties
+source $BASEDIR/.env/ssdt-inventory-import.properties
+#
+# docker login
+echo "Attempting to login to $artifactUrl"
+docker login $artifactUrl -u $artifactUser -p $artifactPassword
+# docker pull
+echo "Attempting to pull $artifactUrl/inventory-importapp:$importVersion"
+docker pull $artifactUrl/inventory-importapp:$importVersion
+#
+echo "Building docker run command"
+dockerParams="--rm --name $entityId-inventory-importapp -v $importPath:/extracts --network $entityId-inventory-net" 
+dockerParams="$dockerParams -e SPRING_DATASOURCE_URL=jdbc:postgresql://$entityId-inventory-db:5432/invdb -e SPRING_DATASOURCE_PASSWORD=$dbPassword"
+dockerParams="$dockerParams -e SPRING_PROFILES_ACTIVE=prod -e APPLICATION_ADMIN_PASSWORD=$adminPassword -i $artifactUrl/inventory-importapp:$importVersion"
+echo "Executing docker run command"
+docker run $dockerParams
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/prod/install-inventory-app.sh	Mon Aug 16 18:46:57 2021 +0100
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+# read required env variables
+BASEDIR="$PWD"
+source $BASEDIR/.env/ssdt-inventory-shared.properties
+source $BASEDIR/.env/ssdt-inventory-app.properties
+#
+# docker login
+echo "Attempting to login to $artifactUrl"
+docker login $artifactUrl -u $artifactUser -p $artifactPassword
+# docker pull app image
+echo "Attempting to pull $artifactUrl/inventory-app:$appVersion"
+docker pull $artifactUrl/inventory-app:$appVersion
+# 
+# Build docker run command based on setting in env files
+echo "Building docker run command"
+dockerRunCommand="docker run --name $entityId-inventory-app --restart=unless-stopped --network $entityId-inventory-net -e SPRING_DATASOURCE_URL=jdbc:postgresql://$entityId-inventory-db:5432/invdb"
+dockerRunCommand="$dockerRunCommand -e SPRING_DATASOURCE_PASSWORD=$dbPassword -e SPRING_PROFILES_ACTIVE=prod -e APPLICATION_ADMIN_PASSWORD=$adminPassword -e JAVA_OPTS=$java_opts"
+dockerRunCommand="$dockerRunCommand -e USAS_CONFIGURATION_HOST=$usasHost -e USAS_CONFIGURATION_PORT=$usasPort -e USAS_CONFIGURATION_APIKEY=$inventoryApiKey -e USAS_CONFIGURATION_REMOTEAPIKEY=$usasApiKey"
+if [ ! -z "$virtualHost" ]; then
+    dockerRunCommand="$dockerRunCommand -e VIRTUAL_HOST=$virtualHost"
+fi
+#
+if [ ! -z "$virtualPort" ]; then
+    dockerRunCommand="$dockerRunCommand -e VIRTUAL_PORT=$virtualPort"
+fi
+#
+if [ ! -z "$letsencryptHost" ]; then
+    dockerRunCommand="$dockerRunCommand -e LETSENCRYPT_HOST=$letsencryptHost"
+fi
+#
+if [ ! -z "$letsencryptEmail" ]; then
+    dockerRunCommand="$dockerRunCommand -e LETSENCRYPT_EMAIL=$letsencryptEmail"
+fi
+#
+if [ ! -z "$hostPort" ]; then
+    dockerRunCommand="$dockerRunCommand -p $hostPort"
+fi
+#
+dockerRunCommand="$dockerRunCommand -d $artifactUrl/inventory-app:$appVersion"
+#
+# Execute constructed docker run command to create $entityId-inventory-app container connected to db and docker network
+echo "Executing docker run command"
+$dockerRunCommand
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/prod/install-inventory-db.sh	Mon Aug 16 18:46:57 2021 +0100
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# read required env variables
+BASEDIR="$PWD"
+source $BASEDIR/.env/ssdt-inventory-shared.properties
+source $BASEDIR/.env/ssdt-inventory-db.properties
+#
+# docker login
+echo "Attempting to login to $artifactUrl"
+docker login $artifactUrl -u $artifactUser -p $artifactPassword
+# docker pull db image 
+echo "Attempting to pull $artifactUrl/inventory-db:$dbVersion"
+docker pull $artifactUrl/inventory-db:$dbVersion
+#
+# Create inventory specific docker network for $entityId 
+echo "Attempting to create $entityId-inventory-net docker network"
+docker network create $entityId-inventory-net
+# docker run inventory-db (data mounted as volume) connected to $entityId-inventory-net docker network
+echo "Attempting to execute docker run command"
+docker run --name $entityId-inventory-db --restart=unless-stopped --mount source=$entityId-inventory-db,target=/var/lib/postgresql/data --network $entityId-inventory-net -e POSTGRES_DB=invdb -e POSTGRES_PASSWORD=$dbPassword -d $artifactUrl/inventory-db:$dbVersion
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/prod/update-inventory-app.sh	Mon Aug 16 18:46:57 2021 +0100
@@ -0,0 +1,51 @@
+#!/bin/bash
+#
+# read required env variables
+BASEDIR="$PWD"
+source $BASEDIR/.env/ssdt-inventory-shared.properties
+source $BASEDIR/.env/ssdt-inventory-app.properties
+#
+# docker login
+echo "Attempting to login to $artifactUrl"
+docker login $artifactUrl -u $artifactUser -p $artifactPassword
+# docker pull app image
+echo "Attempting to pull $artifactUrl/inventory-app:$appVersion"
+docker pull $artifactUrl/inventory-app:$appVersion
+# 
+# docker stop inventory app container
+echo "Attempting to stop $entityId-inventory-app container"
+docker stop $entityId-inventory-app
+#
+# docker rm inventory app container
+echo "Attempting to remove $entityId-inventory-app container"
+docker rm $entityId-inventory-app
+#
+# docker run inventory app container based on new image
+dockerRunCommand="docker run --name $entityId-inventory-app --restart=unless-stopped --network $entityId-inventory-net -e SPRING_DATASOURCE_URL=jdbc:postgresql://$entityId-inventory-db:5432/invdb"
+dockerRunCommand="$dockerRunCommand -e SPRING_DATASOURCE_PASSWORD=$dbPassword -e SPRING_PROFILES_ACTIVE=prod -e APPLICATION_ADMIN_PASSWORD=$adminPassword -e JAVA_OPTS=$java_opts"
+dockerRunCommand="$dockerRunCommand -e USAS_CONFIGURATION_HOST=$usasHost -e USAS_CONFIGURATION_PORT=$usasPort -e USAS_CONFIGURATION_APIKEY=$inventoryApiKey -e USAS_CONFIGURATION_REMOTEAPIKEY=$usasApiKey"
+if [ ! -z "$virtualHost" ]; then
+    dockerRunCommand="$dockerRunCommand -e VIRTUAL_HOST=$virtualHost"
+fi
+#
+if [ ! -z "$virtualPort" ]; then
+    dockerRunCommand="$dockerRunCommand -e VIRTUAL_PORT=$virtualPort"
+fi
+#
+if [ ! -z "$letsencryptHost" ]; then
+    dockerRunCommand="$dockerRunCommand -e LETSENCRYPT_HOST=$letsencryptHost"
+fi
+#
+if [ ! -z "$letsencryptEmail" ]; then
+    dockerRunCommand="$dockerRunCommand -e LETSENCRYPT_EMAIL=$letsencryptEmail"
+fi
+#
+if [ ! -z "$hostPort" ]; then
+    dockerRunCommand="$dockerRunCommand -p $hostPort"
+fi
+#
+dockerRunCommand="$dockerRunCommand -d $artifactUrl/inventory-app:$appVersion"
+#
+# Execute constructed docker run command to create $entityId-inventory-app container connected to db and docker network
+echo "Executing docker run command"
+$dockerRunCommand
--- a/scripts/d-ps.sh	Wed May 20 16:06:34 2020 +0100
+++ b/scripts/d-ps.sh	Mon Aug 16 18:46:57 2021 +0100
@@ -1,4 +1,5 @@
 #!/bin/bash
+#Testing - no changes made
 docker ps -a --format="table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Label \"io.ssdt.id\"}}\t{{.Label \"io.ssdt.app\"}}\t{{.Label \"io.ssdt.type\"}}" $@
 
 
--- a/testbench-grid/Dockerfile	Wed May 20 16:06:34 2020 +0100
+++ b/testbench-grid/Dockerfile	Mon Aug 16 18:46:57 2021 +0100
@@ -1,10 +1,10 @@
 FROM openjdk:8
 
-MAINTAINER Catherine Aldrich <aldrich@ssdt-ohio.org>
+MAINTAINER Catherine Aldrich and Greg Shepherd <shepherd@ssdt-ohio.org>
 
 ENV TESTBENCHJAR=/testbench-standalone.jar
 
-ADD http://files.ssdt.io/vaadin-testbench-standalone-5.1.2.jar $TESTBENCHJAR
+ADD ./vaadin-testbench-standalone-5.2.0.jar $TESTBENCHJAR
 
 EXPOSE 4444
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testbench-grid/docker-compose.yml	Mon Aug 16 18:46:57 2021 +0100
@@ -0,0 +1,18 @@
+grid:
+#   image: testbench-grid:2.0
+#   image: testbench-grid:2.2
+#   image: testbench-grid:latest
+   image: testbench-grid:3.0
+   ports:
+     - 4444:4444
+node:
+#   image: testbench-node:2.0
+#   image: testbench-node:2.1
+#   image: testbench-node:2.3
+#   image: testbench-node:latest
+   image: testbench-node:3.0
+   links:
+     - grid
+   environment:
+     - HUB_HOST=grid_1
+   
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testbench-grid/starting.txt	Mon Aug 16 18:46:57 2021 +0100
@@ -0,0 +1,4 @@
+#Use docker-compose scale to start:  docker-compose scale node=20
+#also need to start the grid: docker-compose up -d grid
+##Use "latest" for old testbench, 2.0 for newest
+##Start grid FIRST and give it time to come up
Binary file testbench-grid/vaadin-testbench-standalone-5.2.0.jar has changed
--- a/testbench-node/Dockerfile	Wed May 20 16:06:34 2020 +0100
+++ b/testbench-node/Dockerfile	Mon Aug 16 18:46:57 2021 +0100
@@ -1,53 +1,47 @@
 FROM openjdk:8
 
-MAINTAINER Catherine Aldrich <aldrich@ssdt-ohio.org>
+MAINTAINER Catherine Aldrich and Greg Shepherd <shepherd@ssdt-ohio.org>
 
 ENV TESTBENCHJAR=/testbench-standalone.jar
 
+# Install PhantomJS
 RUN mkdir /phantom
-
 WORKDIR /phantom
-
-
-
 ADD http://files.ssdt.io/phantomjs-2.1.1-linux-x86_64.tar /phantom/phantomjs.tar
-
 RUN 	tar -xf phantomjs.tar \
 		&& 	mv $(find /phantom -name phantomjs) /bin \
 		&& rm -rf /phantom
-		
+WORKDIR /
 
 RUN apt-get update -y
 
-WORKDIR /
-##Chrome
-ADD http://files.ssdt.io/google-chrome-stable_current_amd64.deb .
-
-RUN apt install -y ./google-chrome-stable_current_amd64.deb
+# Install Chrome browser
+ARG CHROME_84="84.0.4147.30"
+ARG CHROME_85="85.0.4183.83-1"
+ARG CHROME_86="86.0.4240.22-1"
+RUN wget --no-verbose -O /tmp/chrome.deb http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_85}_amd64.deb \
+  && apt install -y /tmp/chrome.deb \
+  && rm /tmp/chrome.deb
 
-RUN rm -rf google-chrome-stable_current_amd64.deb
-
-##Chromium driver (apt-get did notwork)
-ADD http://files.ssdt.io/chromedriver_linux64.zip .
-RUN unzip chromedriver_linux64.zip -d /
+## Install Chromium driver
+ADD ./chromedriver_linux64_85.zip .
+RUN unzip chromedriver_linux64_85.zip -d /
 RUN mv -f /chromedriver /usr/local/bin/chromedriver
-RUN chmod 0755 /usr/local/bin/chromedriver
+RUN chmod 0777 /usr/local/bin/chromedriver
+RUN rm -rf ./chromedriver_linux64_85.zip
 
-#RUN rm chromedriver_linux64.zip
-RUN rm -f /chromedriver_linux64
-##for testing purposes check versions
-RUN google-chrome --version
-RUN chromedriver --version
-
-#RUN apt-get install -y chromium-chromedriver 
-#RUN apt-get install -y chromium-chromedriver
-ADD http://files.ssdt.io/vaadin-testbench-standalone-5.1.2.jar $TESTBENCHJAR
-
-WORKDIR / 
+# Add TestBench jar
+ADD ./vaadin-testbench-standalone-5.2.0.jar $TESTBENCHJAR
 
 COPY ./docker-entrypoint.sh /
+RUN chmod a+x /docker-entrypoint.sh
 
-RUN chmod a+x /docker-entrypoint.sh
+RUN apt-get update -y
+
+RUN chmod 0777 /usr/bin/google-chrome
+
+RUN /usr/bin/google-chrome --version
+RUN /usr/local/bin/chromedriver --version
 
 ENTRYPOINT [ "./docker-entrypoint.sh" ]
 
Binary file testbench-node/chromedriver_linux64_85.zip has changed
Binary file testbench-node/chromedriver_linux64_86.zip has changed
Binary file testbench-node/phantomjs-2.1.1-linux-x86_64.tar has changed
Binary file testbench-node/vaadin-testbench-standalone-5.2.0.jar has changed