Skip to content

Commit

Permalink
add individual compose scripts for idp/sp
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaskey committed Oct 25, 2018
1 parent a81c0a6 commit 5085ee8
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test-compose/idp/compose.sh
Original file line number Diff line number Diff line change
@@ -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
55 changes: 55 additions & 0 deletions test-compose/idp/decompose.sh
Original file line number Diff line number Diff line change
@@ -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

49 changes: 49 additions & 0 deletions test-compose/idp/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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

11 changes: 11 additions & 0 deletions test-compose/sp/compose.sh
Original file line number Diff line number Diff line change
@@ -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
36 changes: 36 additions & 0 deletions test-compose/sp/decompose.sh
Original file line number Diff line number Diff line change
@@ -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

22 changes: 22 additions & 0 deletions test-compose/sp/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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


0 comments on commit 5085ee8

Please sign in to comment.