From e7f6dae8174da2961731076e500f9388176cf791 Mon Sep 17 00:00:00 2001 From: Vincent Massol <vincent@massol.net> Date: Tue, 19 Sep 2017 12:11:47 +0200 Subject: [PATCH] [Misc] Fix the template generation for the XWiki 8.x --- 8/mysql-tomcat/Dockerfile | 8 ++++---- 8/postgres-tomcat/Dockerfile | 8 ++++---- 9/mysql-tomcat/Dockerfile | 2 +- 9/postgres-tomcat/Dockerfile | 2 +- template/Dockerfile | 20 +++++++++++++++----- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/8/mysql-tomcat/Dockerfile b/8/mysql-tomcat/Dockerfile index 000dcf5..c8060ad 100644 --- a/8/mysql-tomcat/Dockerfile +++ b/8/mysql-tomcat/Dockerfile @@ -45,12 +45,12 @@ RUN apt-get update && \ # Create the Tomcat temporary directory # Configure the XWiki permanent directory ENV XWIKI_VERSION=8.4.5 -ENV XWIKI_URL_PREFIX "http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-platform-distribution-war/${XWIKI_VERSION}" +ENV XWIKI_URL_PREFIX "http://maven.xwiki.org/releases/org/xwiki/enterprise/xwiki-enterprise-web/${XWIKI_VERSION}" ENV XWIKI_DOWNLOAD_SHA256 52ed122c44984748a729a784c94cb70ccf0d2fa34c2340d0fd45c75deb3b0bc9 RUN rm -rf /usr/local/tomcat/webapps/* && \ mkdir -p /usr/local/tomcat/temp && \ mkdir -p /usr/local/xwiki/data && \ - curl -fSL "${XWIKI_URL_PREFIX}/xwiki-platform-distribution-war-${XWIKI_VERSION}.war" -o xwiki.war && \ + curl -fSL "${XWIKI_URL_PREFIX}/xwiki-enterprise-web-${XWIKI_VERSION}.war" -o xwiki.war && \ echo "$XWIKI_DOWNLOAD_SHA256 xwiki.war" | sha256sum -c - && \ unzip -d /usr/local/tomcat/webapps/ROOT xwiki.war && \ rm -f xwiki.war @@ -65,8 +65,8 @@ COPY tomcat/setenv.sh /usr/local/tomcat/bin/ COPY xwiki/hibernate.cfg.xml /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml # Set a specific distribution id in XWiki for this docker packaging. -RUN sed -i 's/<id>org.xwiki.platform:xwiki-platform-distribution-war/<id>org.xwiki.platform:xwiki-platform-distribution-docker/' \ - /usr/local/tomcat/webapps/ROOT/META-INF/extension.xed +RUN sed -i 's/<id>org.xwiki.enterprise:xwiki-enterprise-web/<id>org.xwiki.enterprise:xwiki-enterprise-docker/' \ + /usr/local/tomcat/webapps/ROOT/META-INF/extension.xed # Add scripts required to make changes to XWiki configuration files at execution time # Note: we don't run CHMOD since 1) it's not required since the executabe bit is already set in git and 2) running diff --git a/8/postgres-tomcat/Dockerfile b/8/postgres-tomcat/Dockerfile index a119d01..96f3612 100644 --- a/8/postgres-tomcat/Dockerfile +++ b/8/postgres-tomcat/Dockerfile @@ -45,12 +45,12 @@ RUN apt-get update && \ # Create the Tomcat temporary directory # Configure the XWiki permanent directory ENV XWIKI_VERSION=8.4.5 -ENV XWIKI_URL_PREFIX "http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-platform-distribution-war/${XWIKI_VERSION}" +ENV XWIKI_URL_PREFIX "http://maven.xwiki.org/releases/org/xwiki/enterprise/xwiki-enterprise-web/${XWIKI_VERSION}" ENV XWIKI_DOWNLOAD_SHA256 52ed122c44984748a729a784c94cb70ccf0d2fa34c2340d0fd45c75deb3b0bc9 RUN rm -rf /usr/local/tomcat/webapps/* && \ mkdir -p /usr/local/tomcat/temp && \ mkdir -p /usr/local/xwiki/data && \ - curl -fSL "${XWIKI_URL_PREFIX}/xwiki-platform-distribution-war-${XWIKI_VERSION}.war" -o xwiki.war && \ + curl -fSL "${XWIKI_URL_PREFIX}/xwiki-enterprise-web-${XWIKI_VERSION}.war" -o xwiki.war && \ echo "$XWIKI_DOWNLOAD_SHA256 xwiki.war" | sha256sum -c - && \ unzip -d /usr/local/tomcat/webapps/ROOT xwiki.war && \ rm -f xwiki.war @@ -65,8 +65,8 @@ COPY tomcat/setenv.sh /usr/local/tomcat/bin/ COPY xwiki/hibernate.cfg.xml /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml # Set a specific distribution id in XWiki for this docker packaging. -RUN sed -i 's/<id>org.xwiki.platform:xwiki-platform-distribution-war/<id>org.xwiki.platform:xwiki-platform-distribution-docker/' \ - /usr/local/tomcat/webapps/ROOT/META-INF/extension.xed +RUN sed -i 's/<id>org.xwiki.enterprise:xwiki-enterprise-web/<id>org.xwiki.enterprise:xwiki-enterprise-docker/' \ + /usr/local/tomcat/webapps/ROOT/META-INF/extension.xed # Add scripts required to make changes to XWiki configuration files at execution time # Note: we don't run CHMOD since 1) it's not required since the executabe bit is already set in git and 2) running diff --git a/9/mysql-tomcat/Dockerfile b/9/mysql-tomcat/Dockerfile index 20833e2..32ef046 100644 --- a/9/mysql-tomcat/Dockerfile +++ b/9/mysql-tomcat/Dockerfile @@ -66,7 +66,7 @@ COPY xwiki/hibernate.cfg.xml /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cf # Set a specific distribution id in XWiki for this docker packaging. RUN sed -i 's/<id>org.xwiki.platform:xwiki-platform-distribution-war/<id>org.xwiki.platform:xwiki-platform-distribution-docker/' \ - /usr/local/tomcat/webapps/ROOT/META-INF/extension.xed + /usr/local/tomcat/webapps/ROOT/META-INF/extension.xed # Add scripts required to make changes to XWiki configuration files at execution time # Note: we don't run CHMOD since 1) it's not required since the executabe bit is already set in git and 2) running diff --git a/9/postgres-tomcat/Dockerfile b/9/postgres-tomcat/Dockerfile index 786bf7b..c13a3f5 100644 --- a/9/postgres-tomcat/Dockerfile +++ b/9/postgres-tomcat/Dockerfile @@ -66,7 +66,7 @@ COPY xwiki/hibernate.cfg.xml /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cf # Set a specific distribution id in XWiki for this docker packaging. RUN sed -i 's/<id>org.xwiki.platform:xwiki-platform-distribution-war/<id>org.xwiki.platform:xwiki-platform-distribution-docker/' \ - /usr/local/tomcat/webapps/ROOT/META-INF/extension.xed + /usr/local/tomcat/webapps/ROOT/META-INF/extension.xed # Add scripts required to make changes to XWiki configuration files at execution time # Note: we don't run CHMOD since 1) it's not required since the executabe bit is already set in git and 2) running diff --git a/template/Dockerfile b/template/Dockerfile index a3dc5e7..9577033 100644 --- a/template/Dockerfile +++ b/template/Dockerfile @@ -46,12 +46,18 @@ RUN apt-get update && \\ # Create the Tomcat temporary directory # Configure the XWiki permanent directory ENV XWIKI_VERSION=$xwikiVersion -ENV XWIKI_URL_PREFIX "http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-platform-distribution-war/\${XWIKI_VERSION}" +<% if (xwikiVersion.startsWith('8.')) + print 'ENV XWIKI_URL_PREFIX "http://maven.xwiki.org/releases/org/xwiki/enterprise/xwiki-enterprise-web/\${XWIKI_VERSION}"' + else + print 'ENV XWIKI_URL_PREFIX "http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-platform-distribution-war/\${XWIKI_VERSION}"' %> ENV XWIKI_DOWNLOAD_SHA256 $xwikiSha256 RUN rm -rf /usr/local/tomcat/webapps/* && \\ mkdir -p /usr/local/tomcat/temp && \\ mkdir -p /usr/local/xwiki/data && \\ - curl -fSL "\${XWIKI_URL_PREFIX}/xwiki-platform-distribution-war-\${XWIKI_VERSION}.war" -o xwiki.war && \\ + <% if (xwikiVersion.startsWith('8.')) + print 'curl -fSL "\${XWIKI_URL_PREFIX}/xwiki-enterprise-web-\${XWIKI_VERSION}.war" -o xwiki.war && \\' + else + print 'curl -fSL "\${XWIKI_URL_PREFIX}/xwiki-platform-distribution-war-\${XWIKI_VERSION}.war" -o xwiki.war && \\' %> echo "\$XWIKI_DOWNLOAD_SHA256 xwiki.war" | sha256sum -c - && \\ unzip -d /usr/local/tomcat/webapps/ROOT xwiki.war && \\ rm -f xwiki.war @@ -69,9 +75,13 @@ COPY tomcat/setenv.sh /usr/local/tomcat/bin/ COPY xwiki/hibernate.cfg.xml /usr/local/tomcat/webapps/ROOT/WEB-INF/hibernate.cfg.xml # Set a specific distribution id in XWiki for this docker packaging. -RUN sed -i 's/<id>org.xwiki.platform:xwiki-platform-distribution-war/<id>org.xwiki.platform:xwiki-platform-distribution-docker/' \\ - /usr/local/tomcat/webapps/ROOT/META-INF/extension.xed - +<% if (xwikiVersion.startsWith('8.')) { + println 'RUN sed -i \'s/<id>org.xwiki.enterprise:xwiki-enterprise-web/<id>org.xwiki.enterprise:xwiki-enterprise-docker/\' \\' + println ' /usr/local/tomcat/webapps/ROOT/META-INF/extension.xed' + } else { + println 'RUN sed -i \'s/<id>org.xwiki.platform:xwiki-platform-distribution-war/<id>org.xwiki.platform:xwiki-platform-distribution-docker/\' \\' + println ' /usr/local/tomcat/webapps/ROOT/META-INF/extension.xed' + } %> # Add scripts required to make changes to XWiki configuration files at execution time # Note: we don't run CHMOD since 1) it's not required since the executabe bit is already set in git and 2) running # CHMOD after a COPY will sometimes fail, depending on different host-specific factors (especially on AUFS). -- GitLab