diff --git a/.gitignore b/.gitignore index 9929c5c..8ca8e65 100644 --- a/.gitignore +++ b/.gitignore @@ -9,22 +9,5 @@ bin/start.sh bin/stop.sh root/** shibboleth-identity-provider.tar.gz -test.log -bin/build.sh -bin/destroy.sh -bin/install.sh -bin/rebuild.sh -bin/rerun.sh -bin/run.sh -bin/start.sh -bin/stop.sh -bin/test.sh -bin/build.sh -bin/destroy.sh -bin/install.sh -bin/rebuild.sh -bin/rerun.sh -bin/run.sh -bin/start.sh -bin/stop.sh -bin/test.sh +logs/tomcat/** +logs/shibboleth_idp/** diff --git a/Dockerfile b/Dockerfile index 432b412..875d4d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,11 @@ RUN chown -R root:root /opt/shibboleth/shibboleth-identity-provider-$version && rm -rf /usr/local/tomcat/webapps/* && \ ANT_OPTS="-Didp.target.dir=/opt/shibboleth/current" /opt/shibboleth/current/bin/build.sh && \ ln -s /opt/shibboleth/current /opt/shibboleth-idp && \ - ln -s /opt/shibboleth-idp/war/idp.war $CATALINA_HOME/webapps/ROOT.war + ln -s /opt/shibboleth-idp/war/idp.war $CATALINA_HOME/webapps/ROOT.war && \ + touch /usr/local/tomcat/logs/voltest && \ + touch /opt/shibboleth/shibboleth-identity-provider-$version/logs/voltest + +VOLUME ["/usr/local/tomcat/logs", "/opt/shibboleth/shibboleth-identity-provider-$VERSION/logs"] EXPOSE 8080 CMD ["catalina.sh", "run"] \ No newline at end of file diff --git a/bin/ci-run.sh b/bin/ci-run.sh index 755e216..44c5a23 100755 --- a/bin/ci-run.sh +++ b/bin/ci-run.sh @@ -3,4 +3,6 @@ # This file will run a container in the background source common.bash . -docker run -d --name=$imagename -p 8080:8080 $maintainer/$imagename \ No newline at end of file +docker run -d --name=$imagename -v $PWD/logs/tomcat:/usr/local/tomcat/logs:rw \ + -v $PWD/logs/shibboleth_idp:/opt/shibboleth/shibboleth-identity-provider-$version/logs:rw \ + -p 8080:8080 $maintainer/$imagename \ No newline at end of file diff --git a/bin/ci-stop.sh b/bin/ci-stop.sh index 2ac6a32..79d421c 100755 --- a/bin/ci-stop.sh +++ b/bin/ci-stop.sh @@ -3,6 +3,8 @@ # This file will run a container in the background source common.bash . +rm logs/tomcat/* +rm logs/shibboleth_idp/* echo "Cleaning up Docker image($maintainer/$imagename)" docker stop $imagename >> /dev/null docker rm $imagename diff --git a/logs/shibboleth_idp/.gitkeep b/logs/shibboleth_idp/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/logs/tomcat/.gitkeep b/logs/tomcat/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests/running.bats b/tests/running.bats index 4e0ab1b..228e70c 100644 --- a/tests/running.bats +++ b/tests/running.bats @@ -24,3 +24,11 @@ load ../common [ "$status" -eq 0 ] [ ${output} == *"200"* ] } + +@test "Tomcat log directory log volume" { + find logs/tomcat/catalina.*.log +} + +@test "Shibboleth log directory log volume" { + find logs/shibboleth_idp/idp-process.log +} \ No newline at end of file