diff --git a/test-compose/idp/compose.sh b/test-compose/idp/compose.sh new file mode 100755 index 0000000..6c768d5 --- /dev/null +++ b/test-compose/idp/compose.sh @@ -0,0 +1,11 @@ +#!/bin/sh +docker-compose up --build -d + +if [ $? == '0' ]; then + echo "" + echo "If everything above was successful, your IdP metadata can be retreived with this command (after a minute or two):" + echo " curl -k -s https://127.0.0.1/idp/shibboleth" + echo "" +else + echo "An error was encountered." +fi diff --git a/test-compose/idp/decompose.sh b/test-compose/idp/decompose.sh new file mode 100755 index 0000000..02d07bd --- /dev/null +++ b/test-compose/idp/decompose.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +if [ "$1" == '-y' ]; then + response="Y" +else + read -r -p "Are you sure you want to remove the test idp and data images/containers? [y/N] " response +fi + +if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then + #kill, if running, and remove idp container + docker ps | grep idp_idp &>/dev/null + if [ $? == '0' ]; then + #get container ID + export contid=$(docker ps | grep idp_idp | cut -f 1 -d ' ') + docker kill ${contid} &>/dev/null + docker rm ${contid} &>/dev/null + else + #check if an old container is present, rm if needed + docker container ls -a | grep idp_idp &>/dev/null + if [ $? == '0' ]; then + #get container ID + export contid=$(docker container ls -a | grep idp_idp | cut -f 1 -d ' ') + docker kill ${contid} &>/dev/null + docker rm ${contid} &>/dev/null + fi + fi + + #kill, if running, and remove data container + docker ps | grep idp_data &>/dev/null + if [ $? == '0' ]; then + #get container ID + export contid2=$(docker ps | grep idp_data | cut -f 1 -d ' ') + docker kill ${contid2} &>/dev/null + docker rm ${contid2} &>/dev/null + else + #check if an old container is present, rm if needed + docker container ls -a | grep idp_data &>/dev/null + if [ $? == '0' ]; then + #get container ID + export contid2=$(docker container ls -a | grep idp_data | cut -f 1 -d ' ') + docker kill ${contid2} &>/dev/null + docker rm ${contid2} &>/dev/null + fi + fi + + + #remove images + docker rmi -f idp_idp &>/dev/null + docker rmi -f idp_data &>/dev/null + +else + echo "Terminating..." + exit 0 +fi + diff --git a/test-compose/idp/docker-compose.yml b/test-compose/idp/docker-compose.yml new file mode 100644 index 0000000..27a1f1b --- /dev/null +++ b/test-compose/idp/docker-compose.yml @@ -0,0 +1,49 @@ + +version: "3.3" + +services: + idp: + build: + context: ./ + args: + TOMCFG: ./container_files/config/tomcat + TOMCERT: ./container_files/credentials/tomcat + TOMWWWROOT: ./container_files/wwwroot + SHBCFG: ./container_files/config/shib-idp/conf + SHBCREDS: ./container_files/credentials/shib-idp + SHBVIEWS: ./container_files/config/shib-idp/views + SHBEDWAPP: ./container_files/config/shib-idp/edit-webapp + SHBMSGS: ./container_files/config/shib-idp/messages + SHBMD: ./container_files/config/shib-idp/metadata + depends_on: + - data + networks: + - front + - back + ports: + - "443:443" + + + data: + build: ../data/ + expose: + - "389" + networks: + - back + ports: + - "389:389" + volumes: + - shibidp_ldap:/var/lib/dirsrv + + +networks: + front: + driver: bridge + back: + driver: bridge + + +volumes: + shibidp_ldap: + driver: local + diff --git a/test-compose/sp/compose.sh b/test-compose/sp/compose.sh new file mode 100755 index 0000000..4e6ba91 --- /dev/null +++ b/test-compose/sp/compose.sh @@ -0,0 +1,11 @@ +#!/bin/sh +docker-compose up --build -d + +if [ $? == '0' ]; then + echo "" + echo "If everything above was successful, your SP metadata can be retreived with this command (after a minute or two):" + echo " curl -k -s https://127.0.0.1:8443/Shibboleth.sso/Metadata" + echo "" +else + echo "An error was encountered." +fi diff --git a/test-compose/sp/decompose.sh b/test-compose/sp/decompose.sh new file mode 100755 index 0000000..7e80f54 --- /dev/null +++ b/test-compose/sp/decompose.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +if [ "$1" == '-y' ]; then + response="Y" +else + read -r -p "Are you sure you want to remove the test sp image/container? [y/N] " response +fi + +if [[ "$response" =~ ^([yY][eE][sS]|[yY])+$ ]]; then + #kill, if running, and remove sp container + docker ps | grep sp_sp &>/dev/null + if [ $? == '0' ]; then + #get container ID + export contid2=$(docker ps | grep sp_sp | cut -f 1 -d ' ') + docker kill ${contid2} &>/dev/null + docker rm ${contid2} &>/dev/null + else + #check if an old container is present, rm if needed + docker container ls -a | grep sp_sp &>/dev/null + if [ $? == '0' ]; then + #get container ID + export contid2=$(docker container ls -a | grep sp_sp | cut -f 1 -d ' ') + docker kill ${contid2} &>/dev/null + docker rm ${contid2} &>/dev/null + fi + fi + + + #remove images + docker rmi -f sp_sp &>/dev/null + +else + echo "Terminating..." + exit 0 +fi + diff --git a/test-compose/sp/docker-compose.yml b/test-compose/sp/docker-compose.yml new file mode 100644 index 0000000..3c175bf --- /dev/null +++ b/test-compose/sp/docker-compose.yml @@ -0,0 +1,22 @@ + +version: "3.3" + +services: + sp: + build: ./ + expose: + - "8443" + networks: + - front + - back + ports: + - "8443:8443" + + +networks: + front: + driver: bridge + back: + driver: bridge + +