From 892b9ae7da5916cb6997e7bcbd5cc1572693db46 Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 16 Nov 2016 22:10:09 +0100 Subject: [PATCH 1/2] added the link to the directory --- Dockerfile | 2 ++ container_files/bin/configure_php.sh | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index dadee78..e89982a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,6 +71,8 @@ RUN mkdir -p /tmp/comanage && cd /tmp/comanage && \ tar xf $VERSION.tar.gz && \ mv $COMANAGE_PREFIX-$VERSION /opt/comanage/. && \ ln -s /opt/comanage/$VERSION /opt/comanage/current && \ + mkdir /var/cache/registry && \ + ln -s /var/cache/registry /opt/comanage/$COMANAGE_PREFIX-$VERSION/local/tmp && \ # # Cleanup rm -rf /tmp/comanage diff --git a/container_files/bin/configure_php.sh b/container_files/bin/configure_php.sh index c6f7c22..acd039c 100755 --- a/container_files/bin/configure_php.sh +++ b/container_files/bin/configure_php.sh @@ -38,10 +38,14 @@ else fi date >> $log echo "Preparing for cache" >> $log -mkdir -p /opt/comanage/comanage-registry-$VERSION/local/tmp/cache/persistent && \ -mkdir -p /opt/comanage/comanage-registry-$VERSION/local/tmp/cache/models && \ -chmod -R 777 /opt/comanage/comanage-registry-$VERSION/local/tmp/cache && \ -chown -R apache:apache /opt/comanage/comanage-registry-$VERSION/local/tmp/cache && \ +mkdir -p /var/cache/registry/cache/persistent && \ +mkdir -p /var/cache/registry/cache/models && \ +mkdir -p /var/cache/registry/logs && \ +mkdir -p /var/cache/registry/sessions && \ +mkdir -p /var/cache/registry/tests && \ +chmod -R 700 /var/cache/registry && \ +chown -R apache:apache /var/cache/registry && \ +chown -R apache:apache /opt/comanage/comanage-registry-$VERSION/local echo "Cache status: " >> $log ls -la /opt/comanage/comanage-registry-$VERSION/local/tmp/cache >> $log From 0f55a9adf354175fb87d9e2fab6ef8e8504c5c73 Mon Sep 17 00:00:00 2001 From: villadalmine Date: Wed, 16 Nov 2016 22:18:06 +0100 Subject: [PATCH 2/2] added test to check link of cache directory --- tests/image.bats | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/image.bats b/tests/image.bats index 71ff5be..de810a1 100644 --- a/tests/image.bats +++ b/tests/image.bats @@ -20,6 +20,10 @@ load ../common docker run -i $maintainer/$imagename find /opt/comanage/comanage-registry-$version } +@test "COmanage cache link directory created" { + docker run -i $maintainer/$imagename find /opt/comanage/comanage-registry-$version/local/tmp -links 1 + +} @test "Autoexec firstrun capability detected" { docker run -i $maintainer/$imagename find /opt/autoexec/bin/firstrun.sh }