From e66c65af9656fc89eb28ca675a9f1df763585732 Mon Sep 17 00:00:00 2001 From: Chris Hyzer Date: Tue, 22 Sep 2020 00:55:18 -0400 Subject: [PATCH] fix index page and remove error when starting gte when no containers there --- .../usr-local-bin/grouperScriptHooks.sh | 18 ++++++++++++++++++ ex101/run.sh | 2 +- gte | 12 +++++++++--- internal/createNew.txt | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 base/container_files/usr-local-bin/grouperScriptHooks.sh diff --git a/base/container_files/usr-local-bin/grouperScriptHooks.sh b/base/container_files/usr-local-bin/grouperScriptHooks.sh new file mode 100644 index 0000000..a759c39 --- /dev/null +++ b/base/container_files/usr-local-bin/grouperScriptHooks.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +### DO NOT EDIT OR OVERLAY THIS FILE +# These definitions are here to define the functions. +# You can overlay the grouperScriptHooks.sh file with any definitions of these functions + + +# called after the setupFiles functions is called, almost before the process starts +grouperScriptHooks_setupFilesPost() { + echo "trainingContainer; INFO: (grouperScriptHooks.sh-grouperScriptHooks_setupFilesPost) starting..." + sed -i "s|Rewrite|#Rewrite|g" /etc/httpd/conf.d/ssl-enabled.conf + echo "trainingContainer; INFO: (grouperScriptHooks.sh-grouperScriptHooks_setupFilesPost) sed -i 's|Rewrite|#Rewrite|g' /etc/httpd/conf.d/ssl-enabled.conf , result=$?" +} + +export -f grouperScriptHooks_setupFilesPost + +echo "trainingContainer; INFO: (grouperScriptHooks.sh-body) export -f grouperScriptHooks_setupFilesPost, result=$?" + diff --git a/ex101/run.sh b/ex101/run.sh index af927b2..a3bf90c 100755 --- a/ex101/run.sh +++ b/ex101/run.sh @@ -1 +1 @@ -docker run -d -p 389:389 -p 8443:443 -p 3306:3306 --name grouper-demo tier/gte:101.1.1-202006 +docker run -d -p 389:389 -p 8443:443 -p 3306:3306 --name grouper-demo tier/gte:101.1.1-202010 diff --git a/gte b/gte index 16f6d77..f9ae22d 100755 --- a/gte +++ b/gte @@ -7,7 +7,7 @@ if [ -z "$1" ] my_array=( $( docker images | grep 'tier/gte' | grep -v base | awk '{print $2}' | sort ) ) for i in "${my_array[@]}" do - # strip last 7 chars (-202006) + # strip last 7 chars (-202010) i=${i::${#i}-7} echo $i done @@ -16,7 +16,13 @@ fi # remove rabbitmq and all gte containers docker rm -f rabbitmq 2> /dev/null -docker ps -a | grep 'tier/gte' | awk '{print $1}' | xargs docker rm -f + +# see if there is a container +CONTAINER="$( docker ps -a | grep 'tier/gte' | awk '{print $1}' )" +# if so, then rm it +if [ ! -z "$CONTAINER" ]; then + docker ps -a | grep 'tier/gte' | awk '{print $1}' | xargs docker rm -f +fi DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" $DIR/start-rabbitmq.sh @@ -25,5 +31,5 @@ $DIR/start-rabbitmq.sh #docker stop "$1" 2> /dev/null #docker rm "$1" 2> /dev/null -docker run -d -p 8443:443 --link rabbitmq:rabbitmq --name $1 tier/gte:"$1"-202006 +docker run -d -p 8443:443 --link rabbitmq:rabbitmq --name $1 tier/gte:"$1"-202010 diff --git a/internal/createNew.txt b/internal/createNew.txt index f2518f7..1ca140f 100644 --- a/internal/createNew.txt +++ b/internal/createNew.txt @@ -7,7 +7,7 @@ storage 30gig security group: gte-training tag env training -user data script from https://github.internet2.edu/docker/grouper_training/raw/202006-post/internal/userdata.sh +user data script from https://github.internet2.edu/docker/grouper_training/raw/202010-post/internal/userdata.sh ssh -i gte-training-master.pem ec2-user@3.136.154.33