From a836daeeef5e445084d0559b46db5b10bee7d606 Mon Sep 17 00:00:00 2001 From: Matthias Huber Date: Fri, 3 Feb 2017 16:57:08 +0100 Subject: [PATCH] Adjusted volume mappings for environments and profiles --- Dockerfile | 5 +++-- TODO | 1 + run.sh | 21 ++++++++++++++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 TODO diff --git a/Dockerfile b/Dockerfile index 6dfda55..5c55762 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,11 +14,12 @@ RUN apk --no-cache add ca-certificates wget \ && rm *.apk \ && rm /inspectit-cmr.linux.x64.zip \ && cp -ar /CMR/config /CMR/config.orig \ - && cp -ar /CMR/ci /CMR/ci.orig + && mkdir -p /CMR/custom/profiles \ + && mkdir -p /CMR/custom/environments WORKDIR /CMR -VOLUME ["/CMR/config", "/CMR/db", "/CMR/storage", "/CMR/ci"] +VOLUME ["/CMR/config", "/CMR/db", "/CMR/storage", "/CMR/custom/profiles", "/CMR/custom/environments"] EXPOSE 8182 9070 diff --git a/TODO b/TODO new file mode 100644 index 0000000..7984ef5 --- /dev/null +++ b/TODO @@ -0,0 +1 @@ +README Updaten diff --git a/run.sh b/run.sh index 554d448..cd48e52 100755 --- a/run.sh +++ b/run.sh @@ -10,9 +10,24 @@ if [ -z "$(ls /CMR/config)" ];then cp -ra /CMR/config.orig/* /CMR/config/ fi -if [ -z "$(ls /CMR/ci)" ];then - # Copying original ci folder. This is due mounting the ci folder to an empty directory with docker `-v` parameter. Fixing issue #2 - cp -ra /CMR/ci.orig/* /CMR/ci/ +# cleanUp previously created symlinks +find /CMR/ci/profiles -type l -delete +if [ -d "/CMR/ci/environments" ]; then + find /CMR/ci/environments -type l -delete +fi + +if [ "$(ls /CMR/custom/profiles)" ];then + # Create symlinks in /CMR/ci/profiles folder + ln -s /CMR/custom/profiles/* /CMR/ci/profiles + echo "$(ls -la /CMR/ci/profiles/)" +fi + +if [ "$(ls /CMR/custom/environments)" ];then + # Create the folder /CMR/ci/environments as it is non-existing at this point + mkdir -p /CMR/ci/environments + + # Create symlinks in /CMR/ci/environments folder + ln -s /CMR/custom/environments/* /CMR/ci/environments fi exec sh startup.sh