From 937046b0a3cc2ed1d765f1d50e21068031f23b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Mon, 17 Dec 2018 10:07:04 +0100 Subject: [PATCH 01/32] closing #9 --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b787bf6..ba49f56 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,7 +40,7 @@ test-basic: - rm -f build/sade_job-* - mv build/sade /opt/ - bash '/opt/sade/bin/startup.sh' & - - while [ ! -f /opt/sade/sade.beacon ]; do sleep 2s; done && sleep 15s + - while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 2s; done - cd /opt/sade/bin; ./shutdown.sh -u admin -p "$pw" - cd $DIR - mv /opt/sade_job* build/ @@ -72,7 +72,7 @@ generic: - wget --no-check-certificate "https://res.de.dariah.eu/scripts/push-to-aptly.sh" - chmod +x push-to-aptly.sh - ./push-to-aptly.sh - + architrave: stage: deploy allow_failure: true -- GitLab From 4a23f54cc63ba77d9565bc7938e954b4e97234bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Mon, 17 Dec 2018 10:27:08 +0100 Subject: [PATCH 02/32] remove artifact collection --- .gitlab-ci.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ba49f56..2e2e3b4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,19 +34,12 @@ test-basic: - build script: - DIR="$(pwd)" -# write the job id to a file, so that eXist can read it (SADE: post-install.xql) - - echo -n "$CI_JOB_ID" > /tmp/ci.job # remove an old testlogfile - - rm -f build/sade_job-* - mv build/sade /opt/ - bash '/opt/sade/bin/startup.sh' & - while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 2s; done - cd /opt/sade/bin; ./shutdown.sh -u admin -p "$pw" - cd $DIR - - mv /opt/sade_job* build/ - - cat build/sade_job-* - - apt-get -qq update > /dev/null && apt-get -qq install bc > /dev/null - - ./generic-test.sh artifacts: paths: - build/*.xml -- GitLab From 1183f08bff11d347be578e8604742ffbbea4ca99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Mon, 17 Dec 2018 10:38:49 +0100 Subject: [PATCH 03/32] remove deployment on specific branches --- .gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2e2e3b4..2ae42d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,6 +56,11 @@ test-basic: - ./build/sade/bin/startup.sh & sleep 60; ./build/sade/bin/shutdown.sh generic: + only: + - develop + - master + except: + - tags stage: deploy script: - ant -f generic.xml build-debian-package @@ -67,6 +72,11 @@ generic: - ./push-to-aptly.sh architrave: + only: + - develop + - master + except: + - tags stage: deploy allow_failure: true script: -- GitLab From 10d440a6506fc0041e4df26fd051b65082be0014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 08:07:00 +0100 Subject: [PATCH 04/32] load exist via http download instead of git. --- build.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.xml b/build.xml index f401297..06d5588 100644 --- a/build.xml +++ b/build.xml @@ -15,7 +15,12 @@ <target name="build" depends="build-deb-generic, build-deb-project"/> <target name="exist-git" depends="ant-dependencies"> - <git repo="${exist.git}" branch="tags/${exist.tag}" dest="${exist.dest}"/> + <mkdir dir="${build.dir}"/> + <get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${exist.version}.tar.bz2" + dest="${build.dir}/eXist-${exist.version}.tar.bz2" skipexisting="true" quiet="true" /> + <untar src="${build.dir}/eXist-${exist.version}.tar.bz2" dest="${exist.dest}" compression="bzip2"> + <cutdirsmapper dirs="1" /> + </untar> </target> <target name="exist-build-conf" depends="exist-git, junit-ant-patch"> <echo message="configuring eXist"/> -- GitLab From 47d177abd791750c8bc961a7ea7310f408203b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 08:13:26 +0100 Subject: [PATCH 05/32] load eXist via http get instead of git. --- generic.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generic.xml b/generic.xml index dcb0f7b..f9af56d 100644 --- a/generic.xml +++ b/generic.xml @@ -19,7 +19,12 @@ <target name="build" depends="ant-dependencies, artifact-cleanup, sade, dashboard, junit-ant-patch, sade-assets, sade-search, undo-junit-ant-patch, jetty-port, sade-memory"/> <target name="exist-git" depends="ant-dependencies"> - <git repo="${exist.git}" branch="tags/${exist.tag}" dest="${exist.dest}"/> + <mkdir dir="${build.dir}"/> + <get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${exist.version}.tar.bz2" + dest="${build.dir}/eXist-${exist.version}.tar.bz2" skipexisting="true" quiet="true" /> + <untar src="${build.dir}/eXist-${exist.version}.tar.bz2" dest="${exist.dest}" compression="bzip2"> + <cutdirsmapper dirs="1" /> + </untar> </target> <target name="exist-build-conf" depends="exist-git, junit-ant-patch"> <echo message="configuring eXist"/> -- GitLab From aa4f6601af8d26ef0aa32a58cf998e714bf23967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 08:16:32 +0100 Subject: [PATCH 06/32] remove unused file: build.xml --- build.xml | 297 ------------------------------------------------------ 1 file changed, 297 deletions(-) delete mode 100644 build.xml diff --git a/build.xml b/build.xml deleted file mode 100644 index 06d5588..0000000 --- a/build.xml +++ /dev/null @@ -1,297 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project basedir="." name="SADE" default="build" xmlns:ivy="antlib:org.apache.ivy.ant" - xmlns:git="antlib:com.rimerosolutions.ant.git"> - - <description> builds a generic version of SADE, customizable by projects via own parameter - injection. built packages should be moved to autodeploy directory by their targets! </description> - - <property file="generic.build.properties" /> - <property name="ivy.jardir" value="${basedir}/lib"/> - - <tstamp> - <format property="timestamp" pattern="yyyyMMddHHmmss" unit="hour"/> - </tstamp> - - <target name="build" depends="build-deb-generic, build-deb-project"/> - - <target name="exist-git" depends="ant-dependencies"> - <mkdir dir="${build.dir}"/> - <get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${exist.version}.tar.bz2" - dest="${build.dir}/eXist-${exist.version}.tar.bz2" skipexisting="true" quiet="true" /> - <untar src="${build.dir}/eXist-${exist.version}.tar.bz2" dest="${exist.dest}" compression="bzip2"> - <cutdirsmapper dirs="1" /> - </untar> - </target> - <target name="exist-build-conf" depends="exist-git, junit-ant-patch"> - <echo message="configuring eXist"/> - <echo message="patching lucene inlining"/> - <patch patchfile="${resources.dir}/lucene-inline.patch" - originalfile="${exist.dest}/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java" - ignorewhitespace="true" failonerror="false"/> - - <copy file="${exist.dest}/build.properties" tofile="${exist.dest}/local.build.properties" /> - <replace file="${exist.dest}/local.build.properties" token="dashboard,shared,eXide,monex" - value="dashboard,shared,eXide,monex,functx,fundocs,markdown"/> - </target> - <target name="exist-build" depends="exist-build-conf"> - <java classname="org.apache.tools.ant.launch.Launcher" fork="true"> - <arg value="-Dant.home=${exist.dest}/tools/ant"/> - <arg value="-Dant.library.dir=${exist.dest}/tools/ant/lib"/> - <arg value="-Divy.default.ivy.user.dir=${basedir}/ivy"/> - <arg - value="-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl"/> - <arg value="-f"/> - <arg value="${exist.dest}/build.xml"/> - <arg value="all"/> - <arg value="dist"/> - <classpath> - <pathelement location="${exist.dest}/tools/ant/lib/ant-launcher-1.10.1.jar"/> - <!--pathelement path="${java.class.path}"/--> - </classpath> - </java> - </target> - <target name="exist-dist-conf" depends="exist-build"> - <!-- enable autostart scripts --> - <replace file="${exist.dist}/conf.xml"> - <replacetoken><!--<trigger - class="org.exist.collections.triggers.XQueryStartupTrigger"/>--></replacetoken> - <replacevalue><trigger - class="org.exist.collections.triggers.XQueryStartupTrigger"/></replacevalue> - </replace> - - <!-- set backup settings --> - <replace file="${exist.dist}/conf.xml"> - <replacetoken></scheduler></replacetoken> - <replacevalue><job type="system" name="check1" - class="org.exist.storage.ConsistencyCheckTask" - cron-trigger="0 0 23 * * ?"> - <parameter name="output" value="export"/> - <parameter name="backup" value="yes"/> - <parameter name="incremental" value="no"/> - <parameter name="incremental-check" value="no"/> - <parameter name="zip" value="yes"/> - <parameter name="max" value="2"/> - </job> - </scheduler></replacevalue> - </replace> - - </target> - - <target name="prepare-dist-dir" depends="exist-dist-conf"> - <delete dir="${build.dir}/sade"/> - <!-- get updated xars to autodeploy dir --> - <delete dir="${exist.dist}/autodeploy"/> - <mkdir dir="${exist.dist}/autodeploy"/> - <move2autodeploy source="${exist.dest}/autodeploy/"/> - <!-- move eXist to the SADE path --> - <mkdir dir="${build.dir}/sade"/> - <move file="${exist.dist}" tofile="${build.dir}/sade" overwrite="true"/> - - <!-- undo changes to tracked files, so git pull is possible…--> - <patch reverse="true" patchfile="${resources.dir}/lucene-inline.patch" - originalfile="${exist.dest}/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java" - ignorewhitespace="true" failonerror="false"/> - - </target> - - <!-- apply web.xml patch for dashboard, otherwise it will not be visible --> - <target name="dashboard-fix" depends="sade"> - <ant antfile="${build.dir}/sade/extensions/betterform/build.xml" target="patchWebXml" inheritAll="false"/> - </target> - <target name="junit-ant-patch" depends="exist-git"> - <patch patchfile="${resources.dir}/ant-junit-basedir.patch" dir="${exist.dest}" strip="1"/> - </target> - - <!-- SADE --> - <target name="sade" depends="prepare-dist-dir"> - <git repo="${sade.git}" branch="${sade.branch}" dest="${sade.dest}"/> - <ant antfile="${sade.dest}/build.xml" inheritAll="false"/> - <move2autodeploy source="${sade.dest}/build/"/> - </target> - - <target name="tg-sade-connect" depends="prepare-dist-dir"> - <git repo="${tg-sade-connect.git}" branch="${tg-sade-connect.branch}" - dest="${tg-sade-connect.dest}"/> - <ant antfile="${tg-sade-connect.dest}/build.xml" inheritAll="false"/> - <move2autodeploy source="${tg-sade-connect.dest}/build/"/> - </target> - - <target name="tg-sade-defaultproject" depends="prepare-dist-dir"> - <git repo="${tg-sade-defaultproject.git}" branch="${tg-sade-defaultproject.branch}" - dest="${tg-sade-defaultproject.dest}"/> - <ant antfile="${tg-sade-defaultproject.dest}/build.xml" inheritAll="false"/> - <move2autodeploy source="${tg-sade-defaultproject.dest}/build/"/> - </target> - - <target name="sade-search" depends="prepare-dist-dir"> - <mkdir dir="${sade-search.dest}"/> - <get src="${sade-search.build}" dest="${sade-search.dest}"/> - <move2autodeploy source="${sade-search.dest}"/> - </target> - - <!-- apply web.xml patch for dashboard, otherwise it will not be visible --> - <target name="dashboard" depends="sade"> - <ant antfile="${build.dir}/sade/extensions/betterform/build.xml" target="patchWebXml" inheritAll="false"/> - </target> - - <target name="projectapp" depends="prepare-dist-dir" if="projectapp.git" - description="builds a project specific app that contains more specific files and sets up the db in a postinstall.xq"> - <git repo="${projectapp.git}" branch="${projectapp.branch}" - dest="${projectapp.dest}"/> - <ant antfile="${projectapp.dest}/build.xml" target="${projectapp.target}" inheritAll="false"/> - <move2autodeploy source="${projectapp.dest}/build/"/> - </target> - - <target name="build-deb-project" if="projectapp.git" - depends="sade, dashboard-fix, junit-ant-patch, tg-sade-connect, tg-sade-defaultproject, sade-search, projectapp"> - <echo message="Successfully built a project specific version of SADE. Very well."/> - </target> - - <target name="build-deb-generic" unless="projectapp.git" - depends="sade, dashboard-fix, tg-sade-connect, tg-sade-defaultproject, sade-search"> - <echo message="Successfully built a generic version of SADE. Very well."/> - </target> - - <target name="build-targz"/> - - <!-- ************************************* --> - <!-- * ALL DEPENDENCIES BELOW THIS LINE! * --> - <!-- ************************************* --> - <target name="ant-dependencies" depends="install-ivy"> - <property name="ivy.default.ivy.user.dir" value="${basedir}/ivy"/> - <ivy:retrieve conf="tasks"/> - <path id="classpath"> - <fileset dir="./lib"> - <include name="*.jar"/> - </fileset> - </path> - <!-- git --> - <taskdef uri="antlib:com.rimerosolutions.ant.git" - resource="com/rimerosolutions/ant/git/jgit-ant-lib.xml" classpathref="classpath"/> - <!-- contrib has if --> - <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="classpath"/> - <!-- jdeb --> - <taskdef name="deb" classname="org.vafer.jdeb.ant.DebAntTask" classpathref="classpath"/> - </target> - - <target name="download-ivy" unless="skip.download"> - <mkdir dir="${ivy.jardir}"/> - <get - src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" - dest="${ivy.jarfile}" usetimestamp="true"/> - </target> - - <target name="install-ivy" depends="download-ivy" description="installs ivy"> - <path id="ivy.lib.path"> - <pathelement location="${ivy.jarfile}"/> - </path> - <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" - classpathref="ivy.lib.path"/> - </target> - - <macrodef name="move2autodeploy"> - <attribute name="source"/> - <sequential> - <move todir="${build.dir}/sade/autodeploy/"> - <fileset dir="@{source}"> - <include name="*.xar"/> - </fileset> - </move> - </sequential> - </macrodef> - - <macrodef name="git"> - <attribute name="repo"/> - <attribute name="branch"/> - <attribute name="dest"/> - <sequential> - <if> - <available file="@{dest}" type="dir"/> - <then> - <echo message="updating @{dest} from @{repo}"/> - <if> - <matches string="@{branch}" pattern="^tags/.*" /> - <then> - <echo message="checking out tag: @{branch}"/> - <git:git directory="@{dest}" verbose="false"> - <git:fetch uri="@{repo}" /> - <git:checkout branchname="@{branch}" failonerror="true"/> - </git:git> - </then> - <else> - <echo message="pulling from branch: @{branch}"/> - <git-branch-checkout-pull repo="@{repo}" branch="@{branch}" dest="@{dest}"/> - </else> - </if> - </then> - <else> - <if> - <matches string="@{branch}" pattern="^tags/.*" /> - <then> - <echo message="cloning @{repo} and checkout tag"/> - <git:git directory="@{dest}" verbose="false"> - <git:clone uri="@{repo}"/> - <git:checkout branchname="@{branch}"/> - </git:git> - </then> - <else> - <echo message="cloning @{repo} to @{dest}"/> - <git:git directory="@{dest}" verbose="false"> - <git:clone uri="@{repo}" branchtotrack="@{branch}"/> - </git:git> - </else> - </if> - </else> - </if> - </sequential> - </macrodef> - - <!-- the git:checkout task does not so well in checkount and setting new remote - tracking branches, the following task is a workaround --> - <macrodef name="git-branch-checkout-pull"> - <attribute name="repo"/> - <attribute name="branch"/> - <attribute name="dest"/> - <sequential> - - <git:git directory="@{dest}" verbose="false"> - <git:fetch uri="@{repo}" /> - <git:branchlist outputfilename="@{dest}/git.branches"/> - </git:git> - - <loadfile property="localBranchLine" srcfile="@{dest}/git.branches"> - <filterchain> - <linecontains> - <contains value="* @{branch}"></contains> - </linecontains> - </filterchain> - </loadfile> - - <if> - <isset property="localBranchLine"/> - <then> - <git:git directory="@{dest}" verbose="false"> - <git:checkout branchname="@{branch}" failonerror="true" /> - <git:pull uri="@{repo}" /> - </git:git> - </then> - <else> - <echo message="no local branch existing yet, create and set remote tracking"/> - <git:git directory="@{dest}" verbose="false"> - <git:checkout branchname="@{branch}" failonerror="true" createbranch="true" startpoint="@{branch}" /> - </git:git> - <echo file="@{dest}/.git/config" append="true"> - [branch "@{branch}"] - remote = origin - merge = refs/heads/@{branch} - </echo> - <git:git directory="@{dest}" verbose="false"> - <git:pull uri="@{repo}" /> - </git:git> - </else> - </if> - - </sequential> - </macrodef> - -</project> -- GitLab From c87a46469f7568a276f9d4b41c46546f46de2890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 08:16:49 +0100 Subject: [PATCH 07/32] minor format --- generic.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/generic.xml b/generic.xml index f9af56d..c9c919b 100644 --- a/generic.xml +++ b/generic.xml @@ -26,6 +26,7 @@ <cutdirsmapper dirs="1" /> </untar> </target> + <target name="exist-build-conf" depends="exist-git, junit-ant-patch"> <echo message="configuring eXist"/> <echo message="patching lucene inlining"/> -- GitLab From 63e55e6a68be61866a4e25c5534427d19c91d86f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 09:18:29 +0100 Subject: [PATCH 08/32] moving xslt to resources, set a macro for inplace xslt transformation --- generic.xml | 69 ++++++++++--------- .../configure-xinclude-handling.xsl | 0 .../jetty-port-update.xsl | 0 3 files changed, 35 insertions(+), 34 deletions(-) rename configure-xinclude-handling.xsl => resources/configure-xinclude-handling.xsl (100%) rename jetty-port-update.xsl => resources/jetty-port-update.xsl (100%) diff --git a/generic.xml b/generic.xml index c9c919b..4822bfc 100644 --- a/generic.xml +++ b/generic.xml @@ -101,36 +101,25 @@ <!-- Port configuration --> <target name="jetty-port" depends="prepare-dist-dir"> <!-- HTTP port --> - <xslt - in="${build.dir}/sade/tools/jetty/etc/jetty-http.xml" - out="${build.dir}/sade/tools/jetty/etc/jetty-http-tmp.xml" - style="jetty-port-update.xsl"> + <xslt-inplace + input="${build.dir}/sade/tools/jetty/etc/jetty-http.xml" + stylesheet="${resources.dir}/jetty-port-update.xsl"> <param name="customPort" expression="${jetty.http.port}"/> - </xslt> - <move - file="${build.dir}/sade/tools/jetty/etc/jetty-http-tmp.xml" - tofile="${build.dir}/sade/tools/jetty/etc/jetty-http.xml"/> + </xslt-inplace> + <!-- HTTPS port --> - <xslt - in="${build.dir}/sade/tools/jetty/etc/jetty-ssl.xml" - out="${build.dir}/sade/tools/jetty/etc/jetty-ssl-tmp.xml" - style="jetty-port-update.xsl"> + <xslt-inplace + input="${build.dir}/sade/tools/jetty/etc/jetty-ssl.xml" + stylesheet="${resources.dir}/jetty-port-update.xsl"> <param name="customPort" expression="${jetty.https.port}"/> - </xslt> - <move - file="${build.dir}/sade/tools/jetty/etc/jetty-ssl-tmp.xml" - tofile="${build.dir}/sade/tools/jetty/etc/jetty-ssl.xml"/> - - <xslt - in="${build.dir}/sade/tools/jetty/etc/jetty.xml" - out="${build.dir}/sade/tools/jetty/etc/jetty-tmp.xml" - style="jetty-port-update.xsl"> + </xslt-inplace> + + <xslt-inplace + input="${build.dir}/sade/tools/jetty/etc/jetty.xml" + stylesheet="${resources.dir}/jetty-port-update.xsl"> <param name="customPort" expression="${jetty.https.port}"/> - </xslt> - <move - file="${build.dir}/sade/tools/jetty/etc/jetty-tmp.xml" - tofile="${build.dir}/sade/tools/jetty/etc/jetty.xml"/> + </xslt-inplace> <echo>Jetty HTTP port is set to ${jetty.http.port}.</echo> <echo>Jetty HTTPS port is set to ${jetty.https.port}.</echo> @@ -138,20 +127,15 @@ <target name="configure-xinclude-handling" depends="prepare-dist-dir"> - <xslt - in="${build.dir}/sade/conf.xml" - out="${build.dir}/sade/conf-tmp.xml" - style="configure-xinclude-handling.xsl"> + <xslt-inplace + input="${build.dir}/sade/conf.xml" + stylesheet="${resources.dir}/configure-xinclude-handling.xsl"> <param name="configParam" expression="${exist.enable-xinclude}"/> - </xslt> - <move - file="${build.dir}/sade/conf-tmp.xml" - tofile="${build.dir}/sade/conf.xml"/> + </xslt-inplace> <echo>Are XIncludes expanded automatically? ${exist.enable-xinclude}.</echo> </target> - <target name="prepare-dist-dir" depends="exist-dist-conf"> <delete dir="${build.dir}/sade"/> <!-- get updated xars to autodeploy dir --> @@ -308,6 +292,23 @@ </sequential> </macrodef> + <macrodef name="xslt-inplace"> + <attribute name="input"/> + <attribute name="stylesheet"/> + <element name="param" optional="yes"/> + <sequential> + <xslt + in="@{input}" + out="@{input}.tmp" + style="@{stylesheet}"> + <param /> + </xslt> + <move + file="@{input}.tmp" + tofile="@{input}"/> + </sequential> + </macrodef> + <macrodef name="git"> <attribute name="repo"/> <attribute name="branch"/> diff --git a/configure-xinclude-handling.xsl b/resources/configure-xinclude-handling.xsl similarity index 100% rename from configure-xinclude-handling.xsl rename to resources/configure-xinclude-handling.xsl diff --git a/jetty-port-update.xsl b/resources/jetty-port-update.xsl similarity index 100% rename from jetty-port-update.xsl rename to resources/jetty-port-update.xsl -- GitLab From 6750dcd36ff989f26e58882eef702d3c5c3741c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 09:19:19 +0100 Subject: [PATCH 09/32] prepare conf.xml with XSLT --- generic.xml | 83 ++++++--------------- resources/configure-backup.xsl | 26 +++++++ resources/configure-startupTrigger.xsl | 17 +++++ resources/configure-whitespace-preserve.xsl | 18 +++++ 4 files changed, 82 insertions(+), 62 deletions(-) create mode 100644 resources/configure-backup.xsl create mode 100644 resources/configure-startupTrigger.xsl create mode 100644 resources/configure-whitespace-preserve.xsl diff --git a/generic.xml b/generic.xml index 4822bfc..f3c416c 100644 --- a/generic.xml +++ b/generic.xml @@ -16,78 +16,37 @@ <format property="timestamp" pattern="yyyyMMddHHmmss" unit="hour"/> </tstamp> - <target name="build" depends="ant-dependencies, artifact-cleanup, sade, dashboard, junit-ant-patch, sade-assets, sade-search, undo-junit-ant-patch, jetty-port, sade-memory"/> + <target name="build" depends="ant-dependencies, artifact-cleanup, exist, sade, dashboard, junit-ant-patch, sade-assets, sade-search, jetty-port, sade-memory"/> - <target name="exist-git" depends="ant-dependencies"> + <target name="exist" depends="ant-dependencies"> + <echo message="loading eXist" /> <mkdir dir="${build.dir}"/> <get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${exist.version}.tar.bz2" dest="${build.dir}/eXist-${exist.version}.tar.bz2" skipexisting="true" quiet="true" /> <untar src="${build.dir}/eXist-${exist.version}.tar.bz2" dest="${exist.dest}" compression="bzip2"> <cutdirsmapper dirs="1" /> </untar> - </target> - - <target name="exist-build-conf" depends="exist-git, junit-ant-patch"> - <echo message="configuring eXist"/> - <echo message="patching lucene inlining"/> - <patch patchfile="${resources.dir}/lucene-inline.patch" - originalfile="${exist.dest}/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java" - ignorewhitespace="true" failonerror="false"/> - <copy file="${exist.dest}/build.properties" tofile="${exist.dest}/local.build.properties" /> - <replace file="${exist.dest}/local.build.properties" token="dashboard,shared,eXide,monex" - value="dashboard,shared,eXide,monex,functx,fundocs,markdown"/> - </target> - <target name="exist-build" depends="exist-build-conf"> - <!-- using ant from eXist distribution --> - <first id="antjar"> - <fileset dir="${exist.dest}/tools/ant" includes="**/ant-launcher-*.jar" /> - </first> - <java classname="org.apache.tools.ant.launch.Launcher" fork="true"> - <arg value="-Dant.home=${exist.dest}/tools/ant"/> - <arg value="-Dant.library.dir=${exist.dest}/tools/ant/lib"/> - <arg value="-Divy.default.ivy.user.dir=${basedir}/ivy"/> - <arg - value="-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl"/> - <arg value="-f"/> - <arg value="${exist.dest}/build.xml"/> - <arg value="all"/> - <arg value="dist"/> - <classpath> - <pathelement location="${toString:antjar}"/> - <!--pathelement path="${java.class.path}"/--> - </classpath> - </java> + <echo message="loading dependencies to autodeploy"/> + <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=markdown&processor=${exist.version}" dest="${exist.dest}/autodeploy/markdown-latest.xar" ignoreerrors="true"/> + <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=functx&processor=${exist.version}" dest="${exist.dest}/autodeploy/functx-latest.xar" ignoreerrors="true"/> + <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=fundocs&processor=${exist.version}" dest="${exist.dest}/autodeploy/fundocs-latest.xar" ignoreerrors="true"/> </target> - <target name="exist-dist-conf" depends="exist-build"> + + <target name="exist-dist-conf"> <!-- enable autostart scripts --> - <replace file="${exist.dist}/conf.xml"> - <replacetoken><!--<trigger - class="org.exist.collections.triggers.XQueryStartupTrigger"/>--></replacetoken> - <replacevalue><trigger - class="org.exist.collections.triggers.XQueryStartupTrigger"/></replacevalue> - </replace> - <replace file="${exist.dist}/conf.xml"> - <replacetoken>preserve-whitespace-mixed-content="no"</replacetoken> - <replacevalue>preserve-whitespace-mixed-content="yes"</replacevalue> - </replace> + <xslt-inplace + input="${exist.dist}/conf.xml" + stylesheet="${resource.dir}/configure-startupTrigger.xsl" /> - <!-- set backup settings --> - <replace file="${exist.dist}/conf.xml"> - <replacetoken></scheduler></replacetoken> - <replacevalue><job type="system" name="check1" - class="org.exist.storage.ConsistencyCheckTask" - cron-trigger="0 0 23 * * ?"> - <parameter name="output" value="export"/> - <parameter name="backup" value="yes"/> - <parameter name="incremental" value="no"/> - <parameter name="incremental-check" value="no"/> - <parameter name="zip" value="yes"/> - <parameter name="max" value="2"/> - </job> - </scheduler></replacevalue> - </replace> + <xslt-inplace + input="${exist.dist}/conf.xml" + stylesheet="${resource.dir}/configure-whitespace-preserve.xsl" /> + <!-- set backup settings --> + <xslt-inplace + input="${exist.dist}/conf.xml" + stylesheet="${resource.dir}/configure-backup.xsl" /> </target> <target name="sade-memory" depends="exist-dist-conf"> @@ -180,10 +139,10 @@ <target name="dashboard" depends="sade"> <ant antfile="${build.dir}/sade/extensions/betterform/build.xml" target="patchWebXml" inheritAll="false"/> </target> - <target name="junit-ant-patch" depends="exist-git"> + <target name="junit-ant-patch" depends="exist"> <patch patchfile="${resources.dir}/ant-junit-basedir.patch" dir="${exist.dest}" strip="1"/> </target> - <target name="undo-junit-ant-patch" depends="exist-build"> + <target name="undo-junit-ant-patch"> <patch reverse="yes" patchfile="${resources.dir}/ant-junit-basedir.patch" dir="${exist.dest}" strip="1"/> </target> diff --git a/resources/configure-backup.xsl b/resources/configure-backup.xsl new file mode 100644 index 0000000..15a721a --- /dev/null +++ b/resources/configure-backup.xsl @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> + <xsl:param name="configParam"/> + + <xsl:template match="@* | node()"> + <xsl:copy> + <xsl:apply-templates select="@* | node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="scheduler"> + <xsl:apply-templates /> + <job type="system" name="check1" + class="org.exist.storage.ConsistencyCheckTask" + cron-trigger="0 0 23 * * ?"> + <parameter name="output" value="export"/> + <parameter name="backup" value="yes"/> + <parameter name="incremental" value="no"/> + <parameter name="incremental-check" value="no"/> + <parameter name="zip" value="yes"/> + <parameter name="max" value="2"/> + </job> + </xsl:template> + +</xsl:stylesheet> diff --git a/resources/configure-startupTrigger.xsl b/resources/configure-startupTrigger.xsl new file mode 100644 index 0000000..cbedd4e --- /dev/null +++ b/resources/configure-startupTrigger.xsl @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> + <xsl:param name="configParam"/> + + <xsl:template match="@* | node()"> + <xsl:copy> + <xsl:apply-templates select="@* | node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="triggers"> + <xsl:apply-templates /> + <trigger class="org.exist.collections.triggers.XQueryStartupTrigger"/> + </xsl:template> + +</xsl:stylesheet> diff --git a/resources/configure-whitespace-preserve.xsl b/resources/configure-whitespace-preserve.xsl new file mode 100644 index 0000000..bffcac3 --- /dev/null +++ b/resources/configure-whitespace-preserve.xsl @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> + <xsl:param name="configParam"/> + + <xsl:template match="@* | node()"> + <xsl:copy> + <xsl:apply-templates select="@* | node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="@preserve-whitespace-mixed-content"> + <xsl:attribute name="preserve-whitespace-mixed-content"> + <xsl:value-of select="yes"/> + </xsl:attribute> + </xsl:template> + +</xsl:stylesheet> -- GitLab From 82d16677e418bf96918eada357867426443adf5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 09:19:29 +0100 Subject: [PATCH 10/32] update to eXist 4.5.0 --- generic.build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic.build.properties b/generic.build.properties index 3c0e004..fb0c6ad 100644 --- a/generic.build.properties +++ b/generic.build.properties @@ -11,7 +11,7 @@ ivy.jarfile=${ivy.jardir}/ivy.jar # eXist configuration exist.git=https\://github.com/eXist-db/exist.git -exist.version=4.4.0 +exist.version=4.5.0 exist.tag=eXist-${exist.version} exist.dest=${build.dir}/exist exist.dist=${exist.dest}/dist/eXist-db-${exist.version} -- GitLab From 5830a54b24b0ca85deb4035f5f5dd7f735232436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 09:47:48 +0100 Subject: [PATCH 11/32] refactored build process MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * increased usage of xslt (update-safe) * remove usage of eXist's “dist†target (ant) * fix xinclude xslt --- generic.build.properties | 1 - generic.xml | 25 +++++++------------ resources/configure-backup.xsl | 27 +++++++++++---------- resources/configure-startupTrigger.xsl | 9 ++++--- resources/configure-whitespace-preserve.xsl | 3 +-- resources/configure-xinclude-handling.xsl | 6 ++--- 6 files changed, 32 insertions(+), 39 deletions(-) diff --git a/generic.build.properties b/generic.build.properties index fb0c6ad..6d4c2f8 100644 --- a/generic.build.properties +++ b/generic.build.properties @@ -14,7 +14,6 @@ exist.git=https\://github.com/eXist-db/exist.git exist.version=4.5.0 exist.tag=eXist-${exist.version} exist.dest=${build.dir}/exist -exist.dist=${exist.dest}/dist/eXist-db-${exist.version} exist.memory=2048 exist.enable-xinclude=no diff --git a/generic.xml b/generic.xml index f3c416c..c36c275 100644 --- a/generic.xml +++ b/generic.xml @@ -36,17 +36,18 @@ <target name="exist-dist-conf"> <!-- enable autostart scripts --> <xslt-inplace - input="${exist.dist}/conf.xml" - stylesheet="${resource.dir}/configure-startupTrigger.xsl" /> + input="${exist.dest}/conf.xml" + stylesheet="${resources.dir}/configure-startupTrigger.xsl" /> + <!-- enable startup trigger --> <xslt-inplace - input="${exist.dist}/conf.xml" - stylesheet="${resource.dir}/configure-whitespace-preserve.xsl" /> + input="${exist.dest}/conf.xml" + stylesheet="${resources.dir}/configure-whitespace-preserve.xsl" /> <!-- set backup settings --> <xslt-inplace - input="${exist.dist}/conf.xml" - stylesheet="${resource.dir}/configure-backup.xsl" /> + input="${exist.dest}/conf.xml" + stylesheet="${resources.dir}/configure-backup.xsl" /> </target> <target name="sade-memory" depends="exist-dist-conf"> @@ -97,18 +98,10 @@ <target name="prepare-dist-dir" depends="exist-dist-conf"> <delete dir="${build.dir}/sade"/> - <!-- get updated xars to autodeploy dir --> - <delete dir="${exist.dist}/autodeploy"/> - <mkdir dir="${exist.dist}/autodeploy"/> - <move2autodeploy source="${exist.dest}/autodeploy/"/> - - <copy todir="${build.dir}/sade/lib/test"> - <fileset dir="${exist.dest}/lib/test"/> - </copy> <!-- move eXist to the SADE path --> <mkdir dir="${build.dir}/sade"/> - <move file="${exist.dist}" tofile="${build.dir}/sade" overwrite="true"/> + <move file="${exist.dest}" tofile="${build.dir}/sade" overwrite="true"/> <!-- undo changes to tracked files, so git pull is possible…--> <patch reverse="true" patchfile="${resources.dir}/lucene-inline.patch" originalfile="${exist.dest}/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java" @@ -254,7 +247,7 @@ <macrodef name="xslt-inplace"> <attribute name="input"/> <attribute name="stylesheet"/> - <element name="param" optional="yes"/> + <element name="param" optional="yes" implicit="true"/> <sequential> <xslt in="@{input}" diff --git a/resources/configure-backup.xsl b/resources/configure-backup.xsl index 15a721a..18c568b 100644 --- a/resources/configure-backup.xsl +++ b/resources/configure-backup.xsl @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> - <xsl:param name="configParam"/> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/> <xsl:template match="@* | node()"> <xsl:copy> @@ -10,17 +9,19 @@ </xsl:template> <xsl:template match="scheduler"> - <xsl:apply-templates /> - <job type="system" name="check1" - class="org.exist.storage.ConsistencyCheckTask" - cron-trigger="0 0 23 * * ?"> - <parameter name="output" value="export"/> - <parameter name="backup" value="yes"/> - <parameter name="incremental" value="no"/> - <parameter name="incremental-check" value="no"/> - <parameter name="zip" value="yes"/> - <parameter name="max" value="2"/> - </job> + <scheduler> + <xsl:apply-templates /> + <job type="system" name="check1" + class="org.exist.storage.ConsistencyCheckTask" + cron-trigger="0 0 23 * * ?"> + <parameter name="output" value="export"/> + <parameter name="backup" value="yes"/> + <parameter name="incremental" value="no"/> + <parameter name="incremental-check" value="no"/> + <parameter name="zip" value="yes"/> + <parameter name="max" value="2"/> + </job> + </scheduler> </xsl:template> </xsl:stylesheet> diff --git a/resources/configure-startupTrigger.xsl b/resources/configure-startupTrigger.xsl index cbedd4e..269cd5e 100644 --- a/resources/configure-startupTrigger.xsl +++ b/resources/configure-startupTrigger.xsl @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> - <xsl:param name="configParam"/> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/> <xsl:template match="@* | node()"> <xsl:copy> @@ -10,8 +9,10 @@ </xsl:template> <xsl:template match="triggers"> - <xsl:apply-templates /> - <trigger class="org.exist.collections.triggers.XQueryStartupTrigger"/> + <triggers> + <xsl:apply-templates /> + <trigger class="org.exist.collections.triggers.XQueryStartupTrigger"/> + </triggers> </xsl:template> </xsl:stylesheet> diff --git a/resources/configure-whitespace-preserve.xsl b/resources/configure-whitespace-preserve.xsl index bffcac3..7fc68e8 100644 --- a/resources/configure-whitespace-preserve.xsl +++ b/resources/configure-whitespace-preserve.xsl @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> - <xsl:param name="configParam"/> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" /> <xsl:template match="@* | node()"> <xsl:copy> diff --git a/resources/configure-xinclude-handling.xsl b/resources/configure-xinclude-handling.xsl index d85820c..ccdec3b 100644 --- a/resources/configure-xinclude-handling.xsl +++ b/resources/configure-xinclude-handling.xsl @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" /> <xsl:param name="configParam"/> - + <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> - + <xsl:template match="@enable-xinclude"> <xsl:attribute name="enable-xinclude"> <xsl:value-of select="$configParam"/> -- GitLab From 7d2bc675344c0f05336b0fd4d265dc02d43eb563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 10:08:11 +0100 Subject: [PATCH 12/32] use develop specific dependencies and reset to master at CI --- .gitlab-ci.yml | 18 ++++++++++++++++-- generic-master.build.properties | 7 +++++++ generic-test.sh | 20 -------------------- generic.build.properties | 2 +- generic.xml | 14 ++++++++------ 5 files changed, 32 insertions(+), 29 deletions(-) create mode 100644 generic-master.build.properties delete mode 100755 generic-test.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ae42d2..0eb2dd5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,8 +20,22 @@ variables: build: stage: build + except: + - master + script: + # cleanup - just in case there is something cached + - ant -f generic.xml artifact-cleanup + - ant -f generic.xml + artifacts: + paths: + - build/sade/ +build: + stage: build + only: + - master script: -# cleanup - just in case there is something cached + - mv generic-master.build.properties local.build.properties + # cleanup - just in case there is something cached - ant -f generic.xml artifact-cleanup - ant -f generic.xml artifacts: @@ -34,7 +48,7 @@ test-basic: - build script: - DIR="$(pwd)" -# remove an old testlogfile + # remove an old testlogfile - mv build/sade /opt/ - bash '/opt/sade/bin/startup.sh' & - while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 2s; done diff --git a/generic-master.build.properties b/generic-master.build.properties new file mode 100644 index 0000000..036f220 --- /dev/null +++ b/generic-master.build.properties @@ -0,0 +1,7 @@ +#Thu, 29 Jun 2017 12:22:45 +0200 + +# SADE configuration +sade.branch=master + +# SADE Assets configuration +sade-assets.branch=master diff --git a/generic-test.sh b/generic-test.sh deleted file mode 100755 index 5512a8f..0000000 --- a/generic-test.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# test to parse XQSuite -# for details see http://exist-db.org/exist/apps/doc/xqsuite.xml -# -# everything should end with no failures. -# the post-install.xq - responsible to execute the tests under certain -# conditions, writes a "fail" in the resulting documents. - -TEST=$(grep --invert-match 'failures="0"' build/sade_job-*.xml) -TEST=$(grep --no-filename --only-matching --extended-regexp \ - "failures=\"[0-9]+\"" build/sade_job-*.xml \ - | grep --only-matching --extended-regexp "[0-9]+" \ - | paste -sd+ \ - | bc ) -if [ "$TEST" -ne "1" ] - then - echo "there are failing tests."; exit 1 - else - echo "no failures found. good."; exit 0 -fi diff --git a/generic.build.properties b/generic.build.properties index 6d4c2f8..469b7f7 100644 --- a/generic.build.properties +++ b/generic.build.properties @@ -33,7 +33,7 @@ sade-assets.dest=${build.dir}/expkg-sade_assets # Search Index Module, currently maven builded by CI, so only a # URL to the preffered build is needed -sade-search.build=https\://ci.de.dariah.eu/exist-repo/public/fontane-lucene-exist-module-2.0.2.xar +sade-search.build=http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=fontane-lucene-exist-module&processor=${exist.version} sade-search.dest=${build.dir}/expkg-search # debian package diff --git a/generic.xml b/generic.xml index c36c275..b8fda2d 100644 --- a/generic.xml +++ b/generic.xml @@ -2,12 +2,12 @@ <project xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:git="antlib:com.rimerosolutions.ant.git" basedir="." name="SADE" - default="build"> + default="sade"> <description> builds a generic version of SADE, customizable by projects via own parameter injection. built packages should be moved to autodeploy directory by their targets! </description> - <property file="local.generic.build.properties" /> + <property file="local.build.properties" /> <property file="generic.build.properties" /> <property name="ivy.jardir" value="${basedir}/lib"/> @@ -16,7 +16,9 @@ <format property="timestamp" pattern="yyyyMMddHHmmss" unit="hour"/> </tstamp> - <target name="build" depends="ant-dependencies, artifact-cleanup, exist, sade, dashboard, junit-ant-patch, sade-assets, sade-search, jetty-port, sade-memory"/> + <target name="sade" depends="ant-dependencies, artifact-cleanup, exist, sade, dashboard, junit-ant-patch, sade-assets, sade-search, jetty-port, sade-memory"/> + + <target name="exist" depends="exist-load, exist-conf" <target name="exist" depends="ant-dependencies"> <echo message="loading eXist" /> @@ -33,7 +35,7 @@ <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=fundocs&processor=${exist.version}" dest="${exist.dest}/autodeploy/fundocs-latest.xar" ignoreerrors="true"/> </target> - <target name="exist-dist-conf"> + <target name="exist-conf"> <!-- enable autostart scripts --> <xslt-inplace input="${exist.dest}/conf.xml" @@ -96,7 +98,7 @@ <echo>Are XIncludes expanded automatically? ${exist.enable-xinclude}.</echo> </target> - <target name="prepare-dist-dir" depends="exist-dist-conf"> + <target name="prepare-dist-dir" depends="exist"> <delete dir="${build.dir}/sade"/> <!-- move eXist to the SADE path --> @@ -124,7 +126,7 @@ <target name="sade-search" depends="prepare-dist-dir"> <mkdir dir="${sade-search.dest}"/> - <get src="${sade-search.build}" dest="${sade-search.dest}"/> + <get src="${sade-search.build}" dest="${sade-search.dest}/fontane-lucene-exist-module-latest.xar"/> <move2autodeploy source="${sade-search.dest}"/> </target> -- GitLab From a5f94844231e3f11657c884aa79624d69906c530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 11:18:32 +0100 Subject: [PATCH 13/32] moving from git to get --- architrave.xml | 4 +- generic.build.properties | 4 +- generic.xml | 409 +++++++++++++++------------------------ 3 files changed, 158 insertions(+), 259 deletions(-) diff --git a/architrave.xml b/architrave.xml index 81fe1ad..398df86 100644 --- a/architrave.xml +++ b/architrave.xml @@ -5,8 +5,8 @@ xmlns:git="antlib:com.rimerosolutions.ant.git"> <property file="architrave.build.properties"/> - + <property file="generic.build.properties"/> <import file="generic.xml"/> - + </project> diff --git a/generic.build.properties b/generic.build.properties index 469b7f7..006e088 100644 --- a/generic.build.properties +++ b/generic.build.properties @@ -14,7 +14,7 @@ exist.git=https\://github.com/eXist-db/exist.git exist.version=4.5.0 exist.tag=eXist-${exist.version} exist.dest=${build.dir}/exist -exist.memory=2048 +exist.memory=2048m exist.enable-xinclude=no # Jetty port configuration @@ -33,7 +33,7 @@ sade-assets.dest=${build.dir}/expkg-sade_assets # Search Index Module, currently maven builded by CI, so only a # URL to the preffered build is needed -sade-search.build=http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=fontane-lucene-exist-module&processor=${exist.version} +sade-search.abbrev=fontane-lucene-exist-module sade-search.dest=${build.dir}/expkg-search # debian package diff --git a/generic.xml b/generic.xml index b8fda2d..8f0bd54 100644 --- a/generic.xml +++ b/generic.xml @@ -2,25 +2,25 @@ <project xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:git="antlib:com.rimerosolutions.ant.git" basedir="." name="SADE" - default="sade"> + default="build"> - <description> builds a generic version of SADE, customizable by projects via own parameter - injection. built packages should be moved to autodeploy directory by their targets! </description> + <description> + builds a generic version of SADE, customizable by projects via own + parameter injection. built packages should be moved to autodeploy + directory by their targets! + </description> <property file="local.build.properties" /> <property file="generic.build.properties" /> - <property name="ivy.jardir" value="${basedir}/lib"/> - <tstamp> <format property="timestamp" pattern="yyyyMMddHHmmss" unit="hour"/> </tstamp> - <target name="sade" depends="ant-dependencies, artifact-cleanup, exist, sade, dashboard, junit-ant-patch, sade-assets, sade-search, jetty-port, sade-memory"/> - - <target name="exist" depends="exist-load, exist-conf" + <target name="build" depends="artifact-cleanup, sade, sade-assets, sade-search, jetty-port, sade-memory"/> + <target name="exist" depends="exist-load, exist-conf" /> - <target name="exist" depends="ant-dependencies"> + <target name="exist-load" depends="ant-dependencies"> <echo message="loading eXist" /> <mkdir dir="${build.dir}"/> <get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${exist.version}.tar.bz2" @@ -30,38 +30,44 @@ </untar> <echo message="loading dependencies to autodeploy"/> - <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=markdown&processor=${exist.version}" dest="${exist.dest}/autodeploy/markdown-latest.xar" ignoreerrors="true"/> - <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=functx&processor=${exist.version}" dest="${exist.dest}/autodeploy/functx-latest.xar" ignoreerrors="true"/> - <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=fundocs&processor=${exist.version}" dest="${exist.dest}/autodeploy/fundocs-latest.xar" ignoreerrors="true"/> + <get + src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=markdown&processor=${exist.version}" + dest="${exist.dest}/autodeploy/markdown-latest.xar" ignoreerrors="true"/> + <get + src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=functx&processor=${exist.version}" + dest="${exist.dest}/autodeploy/functx-latest.xar" ignoreerrors="true"/> + <get + src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=fundocs&processor=${exist.version}" + dest="${exist.dest}/autodeploy/fundocs-latest.xar" ignoreerrors="true"/> </target> <target name="exist-conf"> - <!-- enable autostart scripts --> - <xslt-inplace - input="${exist.dest}/conf.xml" - stylesheet="${resources.dir}/configure-startupTrigger.xsl" /> - - <!-- enable startup trigger --> - <xslt-inplace - input="${exist.dest}/conf.xml" - stylesheet="${resources.dir}/configure-whitespace-preserve.xsl" /> - - <!-- set backup settings --> - <xslt-inplace - input="${exist.dest}/conf.xml" - stylesheet="${resources.dir}/configure-backup.xsl" /> + <!-- enable autostart scripts --> + <xslt-inplace + input="${exist.dest}/conf.xml" + stylesheet="${resources.dir}/configure-startupTrigger.xsl" /> + + <!-- enable startup trigger --> + <xslt-inplace + input="${exist.dest}/conf.xml" + stylesheet="${resources.dir}/configure-whitespace-preserve.xsl" /> + + <!-- set backup settings --> + <xslt-inplace + input="${exist.dest}/conf.xml" + stylesheet="${resources.dir}/configure-backup.xsl" /> </target> - <target name="sade-memory" depends="exist-dist-conf"> + <target name="sade-memory" depends="exist-conf"> <replace file="${build.dir}/sade/bin/functions.d/eXist-settings.sh" token="Xmx2048m" - value="Xmx${exist.memory}m"/> + value="Xmx${exist.memory}"/> <echo>Total memory available for SADE's eXist-db: ${exist.memory}.</echo> </target> <!-- Port configuration --> - <target name="jetty-port" depends="prepare-dist-dir"> + <target name="jetty-port" depends="prepare-sade-dir"> <!-- HTTP port --> <xslt-inplace input="${build.dir}/sade/tools/jetty/etc/jetty-http.xml" @@ -69,7 +75,6 @@ <param name="customPort" expression="${jetty.http.port}"/> </xslt-inplace> - <!-- HTTPS port --> <xslt-inplace input="${build.dir}/sade/tools/jetty/etc/jetty-ssl.xml" @@ -88,162 +93,115 @@ </target> - <target name="configure-xinclude-handling" depends="prepare-dist-dir"> - <xslt-inplace - input="${build.dir}/sade/conf.xml" - stylesheet="${resources.dir}/configure-xinclude-handling.xsl"> - <param name="configParam" expression="${exist.enable-xinclude}"/> - </xslt-inplace> + <target name="configure-xinclude-handling" depends="prepare-sade-dir"> + <xslt-inplace + input="${build.dir}/sade/conf.xml" + stylesheet="${resources.dir}/configure-xinclude-handling.xsl"> + <param name="configParam" expression="${exist.enable-xinclude}"/> + </xslt-inplace> - <echo>Are XIncludes expanded automatically? ${exist.enable-xinclude}.</echo> + <echo>Are XIncludes expanded automatically? ${exist.enable-xinclude}.</echo> </target> - <target name="prepare-dist-dir" depends="exist"> - <delete dir="${build.dir}/sade"/> + <target name="prepare-sade-dir" depends="exist"> + <delete dir="${build.dir}/sade"/> - <!-- move eXist to the SADE path --> - <mkdir dir="${build.dir}/sade"/> - <move file="${exist.dest}" tofile="${build.dir}/sade" overwrite="true"/> - <!-- undo changes to tracked files, so git pull is possible…--> - <patch reverse="true" patchfile="${resources.dir}/lucene-inline.patch" - originalfile="${exist.dest}/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java" - ignorewhitespace="true" failonerror="false"/> + <!-- move eXist to the SADE path --> + <mkdir dir="${build.dir}/sade"/> + <move file="${exist.dest}" tofile="${build.dir}/sade" overwrite="true"/> + <!-- undo changes to tracked files, so git pull is possible…--> + <patch reverse="true" patchfile="${resources.dir}/lucene-inline.patch" + originalfile="${exist.dest}/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java" + ignorewhitespace="true" failonerror="false"/> </target> <!-- SADE --> - <target name="sade" depends="prepare-dist-dir, sade-assets, sade-memory, jetty-port, configure-xinclude-handling"> - <git repo="${sade.git}" branch="${sade.branch}" dest="${sade.dest}"/> - <ant antfile="${sade.dest}/build.xml" inheritAll="false"/> - <move2autodeploy source="${sade.dest}/build/"/> - </target> + <target name="sade" depends="prepare-sade-dir, sade-assets, sade-memory, jetty-port, configure-xinclude-handling"> + <!-- assets --> + <get + src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=sade_assets&processor=${exist.version}" + dest="${build.dir}/sade/autodeploy/sade_assets-latest.xar" ignoreerrors="true"/> - <!-- SADE Assets --> - <target name="sade-assets" depends="prepare-dist-dir"> - <git repo="${sade-assets.git}" branch="${sade-assets.branch}" dest="${sade-assets.dest}"/> - <ant antfile="${sade-assets.dest}/build.xml" inheritAll="false"/> - <move2autodeploy source="${sade-assets.dest}/build/"/> - </target> + <!-- search --> + <get + src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${sade-search.abbrev}&processor=${exist.version}" + dest="${build.dir}/sade/autodeploy/fontane_lucene_exist_module-latest.xar"/> - <target name="sade-search" depends="prepare-dist-dir"> - <mkdir dir="${sade-search.dest}"/> - <get src="${sade-search.build}" dest="${sade-search.dest}/fontane-lucene-exist-module-latest.xar"/> - <move2autodeploy source="${sade-search.dest}"/> </target> - <!-- apply web.xml patch for dashboard, otherwise it will not be visible --> - <target name="dashboard" depends="sade"> - <ant antfile="${build.dir}/sade/extensions/betterform/build.xml" target="patchWebXml" inheritAll="false"/> - </target> - <target name="junit-ant-patch" depends="exist"> - <patch patchfile="${resources.dir}/ant-junit-basedir.patch" dir="${exist.dest}" strip="1"/> - </target> - <target name="undo-junit-ant-patch"> - <patch reverse="yes" patchfile="${resources.dir}/ant-junit-basedir.patch" dir="${exist.dest}" strip="1"/> - </target> - <target name="build-debian-package" depends="ant-dependencies, artifact-cleanup, sade, dashboard, junit-ant-patch, sade-assets, sade-search"> - <property name="deb.archive.file" value="${build.dir}/${deb.name}_${version}-${timestamp}.tar.gz" /> - <property name="deb.version" value="${version}-${timestamp}" /> - - <!-- https://github.com/tcurdt/jdeb/blob/master/docs/ant.md --> - <copy todir="${build.dir}/deb/control"> - <fileset dir="resources/deb/${deb.name}/control"/> - <filterset begintoken="[[" endtoken="]]"> - <filter token="version" value="${deb.version}"/> - <filter token="description" value="${deb.description}"/> - <filter token="name" value="${deb.name}"/> - </filterset> - </copy> - - <copy file="${deb.initfile.src}" tofile="${build.dir}/sade/bin/sade.init.sh" /> - <exec executable="chmod"> - <arg value="755"/> - <arg value="${build.dir}/sade/bin/sade.init.sh"/> - </exec> - - <tar destfile="${deb.archive.file}" compression="gzip" longfile="gnu"> - <tarfileset dir="${build.dir}/sade" filemode="755" username="${deb.name}" group="${deb.name}"> - <include name="**/*.sh"/> - </tarfileset> - <tarfileset dir="${build.dir}/sade" includes="**" username="${deb.name}" group="${deb.name}"> - <exclude name="**/*.sh"/> - </tarfileset> - </tar> - - <deb destfile="${build.dir}/${deb.name}_${deb.version}.deb" control="${build.dir}/deb/control" verbose="false" > - <data src="${deb.archive.file}" type="archive"> - <mapper type="perm" prefix="/opt/${deb.name}"/> - </data> - </deb> - <delete file="${deb.archive.file}" /> + <target name="debian-package" depends="ant-dependencies, artifact-cleanup, sade, sade-assets, sade-search"> + <property name="deb.archive.file" value="${build.dir}/${deb.name}_${version}-${timestamp}.tar.gz" /> + <property name="deb.version" value="${version}-${timestamp}" /> + + <!-- https://github.com/tcurdt/jdeb/blob/master/docs/ant.md --> + <copy todir="${build.dir}/deb/control"> + <fileset dir="resources/deb/${deb.name}/control"/> + <filterset begintoken="[[" endtoken="]]"> + <filter token="version" value="${deb.version}"/> + <filter token="description" value="${deb.description}"/> + <filter token="name" value="${deb.name}"/> + </filterset> + </copy> + + <copy file="${deb.initfile.src}" tofile="${build.dir}/sade/bin/sade.init.sh" /> + <exec executable="chmod"> + <arg value="755"/> + <arg value="${build.dir}/sade/bin/sade.init.sh"/> + </exec> + + <tar destfile="${deb.archive.file}" compression="gzip" longfile="gnu"> + <tarfileset dir="${build.dir}/sade" filemode="755" username="${deb.name}" group="${deb.name}"> + <include name="**/*.sh"/> + </tarfileset> + <tarfileset dir="${build.dir}/sade" includes="**" username="${deb.name}" group="${deb.name}"> + <exclude name="**/*.sh"/> + </tarfileset> + </tar> + + <deb destfile="${build.dir}/${deb.name}_${deb.version}.deb" control="${build.dir}/deb/control" verbose="false" > + <data src="${deb.archive.file}" type="archive"> + <mapper type="perm" prefix="/opt/${deb.name}"/> + </data> + </deb> + <delete file="${deb.archive.file}" /> </target> <target name="tar-gz-artifact" depends="artifact-cleanup"> - <tar destfile="${build.dir}/sade-${version}.tar.gz" compression="gzip" longfile="gnu"> - <tarfileset dir="${build.dir}/sade" filemode="755"> - <include name="**/*.sh"/> - </tarfileset> - <tarfileset dir="${build.dir}/sade" includes="**"> - <exclude name="**/*.sh"/> - </tarfileset> - </tar> + <tar destfile="${build.dir}/sade-${version}.tar.gz" compression="gzip" longfile="gnu"> + <tarfileset dir="${build.dir}/sade" filemode="755"> + <include name="**/*.sh"/> + </tarfileset> + <tarfileset dir="${build.dir}/sade" includes="**"> + <exclude name="**/*.sh"/> + </tarfileset> + </tar> </target> + <target name="artifact-cleanup"> - <delete dir="${build.dir}/deb" failonerror="false"/> - <delete failonerror="false"> - <fileset dir="${build.dir}"> - <include name="*.deb"/> - <include name="*.changes"/> - <include name="sade*.tar.gz"/> - </fileset> - </delete> + <delete dir="${build.dir}/deb" failonerror="false"/> + <delete failonerror="false"> + <fileset dir="${build.dir}"> + <include name="*.deb"/> + <include name="*.changes"/> + <include name="sade*.tar.gz"/> + </fileset> + </delete> </target> <!-- ************************************* --> - <!-- * ALL DEPENDENCIES BELOW THIS LINE! * --> + <!-- * ALL MACROS BELOW THIS LINE! * --> <!-- ************************************* --> - <target name="ant-dependencies" depends="install-ivy"> - <property name="ivy.default.ivy.user.dir" value="${basedir}/ivy"/> - <ivy:retrieve conf="tasks"/> - <path id="classpath"> - <fileset dir="./lib"> - <include name="*.jar"/> - </fileset> - </path> - <!-- git --> - <taskdef uri="antlib:com.rimerosolutions.ant.git" - resource="com/rimerosolutions/ant/git/jgit-ant-lib.xml" classpathref="classpath"/> - <!-- contrib has if --> - <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="classpath"/> - <!-- jdeb --> - <taskdef name="deb" classname="org.vafer.jdeb.ant.DebAntTask" classpathref="classpath"/> - </target> - - <target name="download-ivy" unless="skip.download"> - <mkdir dir="${ivy.jardir}"/> - <get - src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" - dest="${ivy.jarfile}" usetimestamp="true"/> - </target> - - <target name="install-ivy" depends="download-ivy" description="installs ivy"> - <path id="ivy.lib.path"> - <pathelement location="${ivy.jarfile}"/> - </path> - <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" - classpathref="ivy.lib.path"/> - </target> - <macrodef name="move2autodeploy"> - <attribute name="source"/> - <sequential> - <move todir="${build.dir}/sade/autodeploy/"> - <fileset dir="@{source}"> - <include name="*.xar"/> - </fileset> - </move> - </sequential> + <attribute name="source"/> + <sequential> + <move todir="${build.dir}/sade/autodeploy/"> + <fileset dir="@{source}"> + <include name="*.xar"/> + </fileset> + </move> + </sequential> </macrodef> <macrodef name="xslt-inplace"> @@ -263,98 +221,39 @@ </sequential> </macrodef> - <macrodef name="git"> - <attribute name="repo"/> - <attribute name="branch"/> - <attribute name="dest"/> - <sequential> - <if> - <available file="@{dest}" type="dir"/> - <then> - <echo message="updating @{dest} from @{repo}"/> - <if> - <matches string="@{branch}" pattern="^tags/.*" /> - <then> - <echo message="checking out tag: @{branch}"/> - <git:git directory="@{dest}" verbose="false"> - <git:fetch uri="@{repo}" /> - <git:checkout branchname="@{branch}" failonerror="true"/> - </git:git> - </then> - <else> - <echo message="pulling from branch: @{branch}"/> - <git-branch-checkout-pull repo="@{repo}" branch="@{branch}" dest="@{dest}"/> - </else> - </if> - </then> - <else> - <if> - <matches string="@{branch}" pattern="^tags/.*" /> - <then> - <echo message="cloning @{repo} and checkout tag"/> - <git:git directory="@{dest}" verbose="false"> - <git:clone uri="@{repo}"/> - <git:checkout branchname="@{branch}"/> - </git:git> - </then> - <else> - <echo message="cloning @{repo} to @{dest}"/> - <git:git directory="@{dest}" verbose="false"> - <git:clone uri="@{repo}" branchtotrack="@{branch}"/> - </git:git> - </else> - </if> - </else> - </if> - </sequential> - </macrodef> + <!-- ************************************* --> + <!-- * ALL DEPENDENCIES BELOW THIS LINE! * --> + <!-- ************************************* --> + <target name="ant-dependencies" depends="install-ivy"> + <property name="ivy.default.ivy.user.dir" value="${basedir}/ivy"/> + <ivy:retrieve conf="tasks"/> + <path id="classpath"> + <fileset dir="./lib"> + <include name="*.jar"/> + </fileset> + </path> + <!-- git --> + <taskdef uri="antlib:com.rimerosolutions.ant.git" + resource="com/rimerosolutions/ant/git/jgit-ant-lib.xml" classpathref="classpath"/> + <!-- contrib has if --> + <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="classpath"/> + <!-- jdeb --> + <taskdef name="deb" classname="org.vafer.jdeb.ant.DebAntTask" classpathref="classpath"/> + </target> - <!-- the git:checkout task does not so well in checkount and setting new remote - tracking branches, the following task is a workaround --> - <macrodef name="git-branch-checkout-pull"> - <attribute name="repo"/> - <attribute name="branch"/> - <attribute name="dest"/> - <sequential> - - <git:git directory="@{dest}" verbose="false"> - <git:fetch uri="@{repo}" /> - <git:branchlist outputfilename="@{dest}/git.branches"/> - </git:git> - - <loadfile property="localBranchLine" srcfile="@{dest}/git.branches"> - <filterchain> - <linecontains> - <contains value="* @{branch}"></contains> - </linecontains> - </filterchain> - </loadfile> - - <if> - <isset property="localBranchLine"/> - <then> - <git:git directory="@{dest}" verbose="false"> - <git:checkout branchname="@{branch}" failonerror="true" /> - <git:pull uri="@{repo}" /> - </git:git> - </then> - <else> - <echo message="no local branch existing yet, create and set remote tracking"/> - <git:git directory="@{dest}" verbose="false"> - <git:checkout branchname="@{branch}" failonerror="true" createbranch="true" startpoint="@{branch}" /> - </git:git> - <echo file="@{dest}/.git/config" append="true"> - [branch "@{branch}"] - remote = origin - merge = refs/heads/@{branch} - </echo> - <git:git directory="@{dest}" verbose="false"> - <git:pull uri="@{repo}" /> - </git:git> - </else> - </if> - - </sequential> - </macrodef> + <target name="download-ivy" unless="skip.download"> + <mkdir dir="${ivy.jardir}"/> + <get + src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" + dest="${ivy.jarfile}" usetimestamp="true"/> + </target> + + <target name="install-ivy" depends="download-ivy" description="installs ivy"> + <path id="ivy.lib.path"> + <pathelement location="${ivy.jarfile}"/> + </path> + <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" + classpathref="ivy.lib.path"/> + </target> </project> -- GitLab From 060395e071207735d5612513e5d8b873d3dcef71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 11:19:37 +0100 Subject: [PATCH 14/32] cleanup --- generic.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic.xml b/generic.xml index 8f0bd54..146a81f 100644 --- a/generic.xml +++ b/generic.xml @@ -130,7 +130,7 @@ </target> - <target name="debian-package" depends="ant-dependencies, artifact-cleanup, sade, sade-assets, sade-search"> + <target name="debian-package" depends="ant-dependencies, artifact-cleanup, sade"> <property name="deb.archive.file" value="${build.dir}/${deb.name}_${version}-${timestamp}.tar.gz" /> <property name="deb.version" value="${version}-${timestamp}" /> -- GitLab From 6dcf40697ac714ad3ce255952c09673795817c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 12:09:29 +0100 Subject: [PATCH 15/32] moving from git to get --- generic-master.build.properties | 7 +------ generic.build.properties | 9 ++------- generic.xml | 16 ++++++++++------ 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/generic-master.build.properties b/generic-master.build.properties index 036f220..427f613 100644 --- a/generic-master.build.properties +++ b/generic-master.build.properties @@ -1,7 +1,2 @@ -#Thu, 29 Jun 2017 12:22:45 +0200 - # SADE configuration -sade.branch=master - -# SADE Assets configuration -sade-assets.branch=master +sade.abbrev=SADE diff --git a/generic.build.properties b/generic.build.properties index 006e088..613aada 100644 --- a/generic.build.properties +++ b/generic.build.properties @@ -22,19 +22,14 @@ jetty.http.port=8080 jetty.https.port=8443 # SADE configuration -sade.git=https\://gitlab.gwdg.de/SADE/SADE.git -sade.branch=develop -sade.dest=${build.dir}/expkg-sade +sade.abbrev=SADE-develop # SADE Assets configuration -sade-assets.git=https\://gitlab.gwdg.de/SADE/assets.git -sade-assets.branch=master -sade-assets.dest=${build.dir}/expkg-sade_assets +sade-assets.abbrev=sade_assets # Search Index Module, currently maven builded by CI, so only a # URL to the preffered build is needed sade-search.abbrev=fontane-lucene-exist-module -sade-search.dest=${build.dir}/expkg-search # debian package deb.initfile.src=${resources.dir}/deb/${deb.name}/sade.init.sh diff --git a/generic.xml b/generic.xml index 146a81f..de14c85 100644 --- a/generic.xml +++ b/generic.xml @@ -17,7 +17,7 @@ <format property="timestamp" pattern="yyyyMMddHHmmss" unit="hour"/> </tstamp> - <target name="build" depends="artifact-cleanup, sade, sade-assets, sade-search, jetty-port, sade-memory"/> + <target name="build" depends="artifact-cleanup, sade, jetty-port, sade-memory"/> <target name="exist" depends="exist-load, exist-conf" /> <target name="exist-load" depends="ant-dependencies"> @@ -92,7 +92,6 @@ <echo>Jetty HTTPS port is set to ${jetty.https.port}.</echo> </target> - <target name="configure-xinclude-handling" depends="prepare-sade-dir"> <xslt-inplace input="${build.dir}/sade/conf.xml" @@ -116,16 +115,21 @@ </target> <!-- SADE --> - <target name="sade" depends="prepare-sade-dir, sade-assets, sade-memory, jetty-port, configure-xinclude-handling"> + <target name="sade" depends="prepare-sade-dir, sade-memory, jetty-port, configure-xinclude-handling"> + <!-- SADE --> + <get + src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${sade.abbrev}&processor=${exist.version}" + dest="${build.dir}/sade/autodeploy/${sade.abbrev}-latest.xar"/> + <!-- assets --> <get - src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=sade_assets&processor=${exist.version}" - dest="${build.dir}/sade/autodeploy/sade_assets-latest.xar" ignoreerrors="true"/> + src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${sade-assets.abbrev}&processor=${exist.version}" + dest="${build.dir}/sade/autodeploy/${sade-assets.abbrev}-latest.xar"/> <!-- search --> <get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${sade-search.abbrev}&processor=${exist.version}" - dest="${build.dir}/sade/autodeploy/fontane_lucene_exist_module-latest.xar"/> + dest="${build.dir}/sade/autodeploy/${sade-search.abbrev}-latest.xar"/> </target> -- GitLab From 8c136f57a6341831e95cb18cb871333600e5a3f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 08:07:00 +0100 Subject: [PATCH 16/32] load exist via http download instead of git. --- build.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build.xml b/build.xml index f401297..06d5588 100644 --- a/build.xml +++ b/build.xml @@ -15,7 +15,12 @@ <target name="build" depends="build-deb-generic, build-deb-project"/> <target name="exist-git" depends="ant-dependencies"> - <git repo="${exist.git}" branch="tags/${exist.tag}" dest="${exist.dest}"/> + <mkdir dir="${build.dir}"/> + <get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${exist.version}.tar.bz2" + dest="${build.dir}/eXist-${exist.version}.tar.bz2" skipexisting="true" quiet="true" /> + <untar src="${build.dir}/eXist-${exist.version}.tar.bz2" dest="${exist.dest}" compression="bzip2"> + <cutdirsmapper dirs="1" /> + </untar> </target> <target name="exist-build-conf" depends="exist-git, junit-ant-patch"> <echo message="configuring eXist"/> -- GitLab From 0991b873426a5eaf3fea163681eb734b17bb868c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 08:13:26 +0100 Subject: [PATCH 17/32] load eXist via http get instead of git. --- generic.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generic.xml b/generic.xml index e3ed3b7..78f6f70 100644 --- a/generic.xml +++ b/generic.xml @@ -19,7 +19,12 @@ <target name="build" depends="ant-dependencies, artifact-cleanup, sade, dashboard, junit-ant-patch, sade-assets, sade-search, undo-junit-ant-patch, jetty-port, sade-memory"/> <target name="exist-git" depends="ant-dependencies"> - <git repo="${exist.git}" branch="tags/${exist.tag}" dest="${exist.dest}"/> + <mkdir dir="${build.dir}"/> + <get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${exist.version}.tar.bz2" + dest="${build.dir}/eXist-${exist.version}.tar.bz2" skipexisting="true" quiet="true" /> + <untar src="${build.dir}/eXist-${exist.version}.tar.bz2" dest="${exist.dest}" compression="bzip2"> + <cutdirsmapper dirs="1" /> + </untar> </target> <target name="exist-build-conf" depends="exist-git, junit-ant-patch"> <echo message="configuring eXist"/> -- GitLab From a8c8cb081cf3507a595d24c7cf93393e403ba536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 08:16:32 +0100 Subject: [PATCH 18/32] remove unused file: build.xml --- build.xml | 297 ------------------------------------------------------ 1 file changed, 297 deletions(-) delete mode 100644 build.xml diff --git a/build.xml b/build.xml deleted file mode 100644 index 06d5588..0000000 --- a/build.xml +++ /dev/null @@ -1,297 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project basedir="." name="SADE" default="build" xmlns:ivy="antlib:org.apache.ivy.ant" - xmlns:git="antlib:com.rimerosolutions.ant.git"> - - <description> builds a generic version of SADE, customizable by projects via own parameter - injection. built packages should be moved to autodeploy directory by their targets! </description> - - <property file="generic.build.properties" /> - <property name="ivy.jardir" value="${basedir}/lib"/> - - <tstamp> - <format property="timestamp" pattern="yyyyMMddHHmmss" unit="hour"/> - </tstamp> - - <target name="build" depends="build-deb-generic, build-deb-project"/> - - <target name="exist-git" depends="ant-dependencies"> - <mkdir dir="${build.dir}"/> - <get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${exist.version}.tar.bz2" - dest="${build.dir}/eXist-${exist.version}.tar.bz2" skipexisting="true" quiet="true" /> - <untar src="${build.dir}/eXist-${exist.version}.tar.bz2" dest="${exist.dest}" compression="bzip2"> - <cutdirsmapper dirs="1" /> - </untar> - </target> - <target name="exist-build-conf" depends="exist-git, junit-ant-patch"> - <echo message="configuring eXist"/> - <echo message="patching lucene inlining"/> - <patch patchfile="${resources.dir}/lucene-inline.patch" - originalfile="${exist.dest}/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java" - ignorewhitespace="true" failonerror="false"/> - - <copy file="${exist.dest}/build.properties" tofile="${exist.dest}/local.build.properties" /> - <replace file="${exist.dest}/local.build.properties" token="dashboard,shared,eXide,monex" - value="dashboard,shared,eXide,monex,functx,fundocs,markdown"/> - </target> - <target name="exist-build" depends="exist-build-conf"> - <java classname="org.apache.tools.ant.launch.Launcher" fork="true"> - <arg value="-Dant.home=${exist.dest}/tools/ant"/> - <arg value="-Dant.library.dir=${exist.dest}/tools/ant/lib"/> - <arg value="-Divy.default.ivy.user.dir=${basedir}/ivy"/> - <arg - value="-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl"/> - <arg value="-f"/> - <arg value="${exist.dest}/build.xml"/> - <arg value="all"/> - <arg value="dist"/> - <classpath> - <pathelement location="${exist.dest}/tools/ant/lib/ant-launcher-1.10.1.jar"/> - <!--pathelement path="${java.class.path}"/--> - </classpath> - </java> - </target> - <target name="exist-dist-conf" depends="exist-build"> - <!-- enable autostart scripts --> - <replace file="${exist.dist}/conf.xml"> - <replacetoken><!--<trigger - class="org.exist.collections.triggers.XQueryStartupTrigger"/>--></replacetoken> - <replacevalue><trigger - class="org.exist.collections.triggers.XQueryStartupTrigger"/></replacevalue> - </replace> - - <!-- set backup settings --> - <replace file="${exist.dist}/conf.xml"> - <replacetoken></scheduler></replacetoken> - <replacevalue><job type="system" name="check1" - class="org.exist.storage.ConsistencyCheckTask" - cron-trigger="0 0 23 * * ?"> - <parameter name="output" value="export"/> - <parameter name="backup" value="yes"/> - <parameter name="incremental" value="no"/> - <parameter name="incremental-check" value="no"/> - <parameter name="zip" value="yes"/> - <parameter name="max" value="2"/> - </job> - </scheduler></replacevalue> - </replace> - - </target> - - <target name="prepare-dist-dir" depends="exist-dist-conf"> - <delete dir="${build.dir}/sade"/> - <!-- get updated xars to autodeploy dir --> - <delete dir="${exist.dist}/autodeploy"/> - <mkdir dir="${exist.dist}/autodeploy"/> - <move2autodeploy source="${exist.dest}/autodeploy/"/> - <!-- move eXist to the SADE path --> - <mkdir dir="${build.dir}/sade"/> - <move file="${exist.dist}" tofile="${build.dir}/sade" overwrite="true"/> - - <!-- undo changes to tracked files, so git pull is possible…--> - <patch reverse="true" patchfile="${resources.dir}/lucene-inline.patch" - originalfile="${exist.dest}/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java" - ignorewhitespace="true" failonerror="false"/> - - </target> - - <!-- apply web.xml patch for dashboard, otherwise it will not be visible --> - <target name="dashboard-fix" depends="sade"> - <ant antfile="${build.dir}/sade/extensions/betterform/build.xml" target="patchWebXml" inheritAll="false"/> - </target> - <target name="junit-ant-patch" depends="exist-git"> - <patch patchfile="${resources.dir}/ant-junit-basedir.patch" dir="${exist.dest}" strip="1"/> - </target> - - <!-- SADE --> - <target name="sade" depends="prepare-dist-dir"> - <git repo="${sade.git}" branch="${sade.branch}" dest="${sade.dest}"/> - <ant antfile="${sade.dest}/build.xml" inheritAll="false"/> - <move2autodeploy source="${sade.dest}/build/"/> - </target> - - <target name="tg-sade-connect" depends="prepare-dist-dir"> - <git repo="${tg-sade-connect.git}" branch="${tg-sade-connect.branch}" - dest="${tg-sade-connect.dest}"/> - <ant antfile="${tg-sade-connect.dest}/build.xml" inheritAll="false"/> - <move2autodeploy source="${tg-sade-connect.dest}/build/"/> - </target> - - <target name="tg-sade-defaultproject" depends="prepare-dist-dir"> - <git repo="${tg-sade-defaultproject.git}" branch="${tg-sade-defaultproject.branch}" - dest="${tg-sade-defaultproject.dest}"/> - <ant antfile="${tg-sade-defaultproject.dest}/build.xml" inheritAll="false"/> - <move2autodeploy source="${tg-sade-defaultproject.dest}/build/"/> - </target> - - <target name="sade-search" depends="prepare-dist-dir"> - <mkdir dir="${sade-search.dest}"/> - <get src="${sade-search.build}" dest="${sade-search.dest}"/> - <move2autodeploy source="${sade-search.dest}"/> - </target> - - <!-- apply web.xml patch for dashboard, otherwise it will not be visible --> - <target name="dashboard" depends="sade"> - <ant antfile="${build.dir}/sade/extensions/betterform/build.xml" target="patchWebXml" inheritAll="false"/> - </target> - - <target name="projectapp" depends="prepare-dist-dir" if="projectapp.git" - description="builds a project specific app that contains more specific files and sets up the db in a postinstall.xq"> - <git repo="${projectapp.git}" branch="${projectapp.branch}" - dest="${projectapp.dest}"/> - <ant antfile="${projectapp.dest}/build.xml" target="${projectapp.target}" inheritAll="false"/> - <move2autodeploy source="${projectapp.dest}/build/"/> - </target> - - <target name="build-deb-project" if="projectapp.git" - depends="sade, dashboard-fix, junit-ant-patch, tg-sade-connect, tg-sade-defaultproject, sade-search, projectapp"> - <echo message="Successfully built a project specific version of SADE. Very well."/> - </target> - - <target name="build-deb-generic" unless="projectapp.git" - depends="sade, dashboard-fix, tg-sade-connect, tg-sade-defaultproject, sade-search"> - <echo message="Successfully built a generic version of SADE. Very well."/> - </target> - - <target name="build-targz"/> - - <!-- ************************************* --> - <!-- * ALL DEPENDENCIES BELOW THIS LINE! * --> - <!-- ************************************* --> - <target name="ant-dependencies" depends="install-ivy"> - <property name="ivy.default.ivy.user.dir" value="${basedir}/ivy"/> - <ivy:retrieve conf="tasks"/> - <path id="classpath"> - <fileset dir="./lib"> - <include name="*.jar"/> - </fileset> - </path> - <!-- git --> - <taskdef uri="antlib:com.rimerosolutions.ant.git" - resource="com/rimerosolutions/ant/git/jgit-ant-lib.xml" classpathref="classpath"/> - <!-- contrib has if --> - <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="classpath"/> - <!-- jdeb --> - <taskdef name="deb" classname="org.vafer.jdeb.ant.DebAntTask" classpathref="classpath"/> - </target> - - <target name="download-ivy" unless="skip.download"> - <mkdir dir="${ivy.jardir}"/> - <get - src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" - dest="${ivy.jarfile}" usetimestamp="true"/> - </target> - - <target name="install-ivy" depends="download-ivy" description="installs ivy"> - <path id="ivy.lib.path"> - <pathelement location="${ivy.jarfile}"/> - </path> - <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" - classpathref="ivy.lib.path"/> - </target> - - <macrodef name="move2autodeploy"> - <attribute name="source"/> - <sequential> - <move todir="${build.dir}/sade/autodeploy/"> - <fileset dir="@{source}"> - <include name="*.xar"/> - </fileset> - </move> - </sequential> - </macrodef> - - <macrodef name="git"> - <attribute name="repo"/> - <attribute name="branch"/> - <attribute name="dest"/> - <sequential> - <if> - <available file="@{dest}" type="dir"/> - <then> - <echo message="updating @{dest} from @{repo}"/> - <if> - <matches string="@{branch}" pattern="^tags/.*" /> - <then> - <echo message="checking out tag: @{branch}"/> - <git:git directory="@{dest}" verbose="false"> - <git:fetch uri="@{repo}" /> - <git:checkout branchname="@{branch}" failonerror="true"/> - </git:git> - </then> - <else> - <echo message="pulling from branch: @{branch}"/> - <git-branch-checkout-pull repo="@{repo}" branch="@{branch}" dest="@{dest}"/> - </else> - </if> - </then> - <else> - <if> - <matches string="@{branch}" pattern="^tags/.*" /> - <then> - <echo message="cloning @{repo} and checkout tag"/> - <git:git directory="@{dest}" verbose="false"> - <git:clone uri="@{repo}"/> - <git:checkout branchname="@{branch}"/> - </git:git> - </then> - <else> - <echo message="cloning @{repo} to @{dest}"/> - <git:git directory="@{dest}" verbose="false"> - <git:clone uri="@{repo}" branchtotrack="@{branch}"/> - </git:git> - </else> - </if> - </else> - </if> - </sequential> - </macrodef> - - <!-- the git:checkout task does not so well in checkount and setting new remote - tracking branches, the following task is a workaround --> - <macrodef name="git-branch-checkout-pull"> - <attribute name="repo"/> - <attribute name="branch"/> - <attribute name="dest"/> - <sequential> - - <git:git directory="@{dest}" verbose="false"> - <git:fetch uri="@{repo}" /> - <git:branchlist outputfilename="@{dest}/git.branches"/> - </git:git> - - <loadfile property="localBranchLine" srcfile="@{dest}/git.branches"> - <filterchain> - <linecontains> - <contains value="* @{branch}"></contains> - </linecontains> - </filterchain> - </loadfile> - - <if> - <isset property="localBranchLine"/> - <then> - <git:git directory="@{dest}" verbose="false"> - <git:checkout branchname="@{branch}" failonerror="true" /> - <git:pull uri="@{repo}" /> - </git:git> - </then> - <else> - <echo message="no local branch existing yet, create and set remote tracking"/> - <git:git directory="@{dest}" verbose="false"> - <git:checkout branchname="@{branch}" failonerror="true" createbranch="true" startpoint="@{branch}" /> - </git:git> - <echo file="@{dest}/.git/config" append="true"> - [branch "@{branch}"] - remote = origin - merge = refs/heads/@{branch} - </echo> - <git:git directory="@{dest}" verbose="false"> - <git:pull uri="@{repo}" /> - </git:git> - </else> - </if> - - </sequential> - </macrodef> - -</project> -- GitLab From 66b0d32ae82a15fcaa907dc13ecbca76ae0fc87f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 08:16:49 +0100 Subject: [PATCH 19/32] minor format --- generic.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/generic.xml b/generic.xml index 78f6f70..5a396e4 100644 --- a/generic.xml +++ b/generic.xml @@ -26,6 +26,7 @@ <cutdirsmapper dirs="1" /> </untar> </target> + <target name="exist-build-conf" depends="exist-git, junit-ant-patch"> <echo message="configuring eXist"/> <echo message="patching lucene inlining"/> -- GitLab From 17419db57691d2d8aa583a4aa27dc8623d194a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 09:18:29 +0100 Subject: [PATCH 20/32] moving xslt to resources, set a macro for inplace xslt transformation --- generic.xml | 69 ++++++++++--------- .../configure-xinclude-handling.xsl | 0 .../jetty-port-update.xsl | 0 3 files changed, 35 insertions(+), 34 deletions(-) rename configure-xinclude-handling.xsl => resources/configure-xinclude-handling.xsl (100%) rename jetty-port-update.xsl => resources/jetty-port-update.xsl (100%) diff --git a/generic.xml b/generic.xml index 5a396e4..fad4a0f 100644 --- a/generic.xml +++ b/generic.xml @@ -101,36 +101,25 @@ <!-- Port configuration --> <target name="jetty-port" depends="prepare-dist-dir"> <!-- HTTP port --> - <xslt - in="${build.dir}/sade/tools/jetty/etc/jetty-http.xml" - out="${build.dir}/sade/tools/jetty/etc/jetty-http-tmp.xml" - style="jetty-port-update.xsl"> + <xslt-inplace + input="${build.dir}/sade/tools/jetty/etc/jetty-http.xml" + stylesheet="${resources.dir}/jetty-port-update.xsl"> <param name="customPort" expression="${jetty.http.port}"/> - </xslt> - <move - file="${build.dir}/sade/tools/jetty/etc/jetty-http-tmp.xml" - tofile="${build.dir}/sade/tools/jetty/etc/jetty-http.xml"/> + </xslt-inplace> + <!-- HTTPS port --> - <xslt - in="${build.dir}/sade/tools/jetty/etc/jetty-ssl.xml" - out="${build.dir}/sade/tools/jetty/etc/jetty-ssl-tmp.xml" - style="jetty-port-update.xsl"> + <xslt-inplace + input="${build.dir}/sade/tools/jetty/etc/jetty-ssl.xml" + stylesheet="${resources.dir}/jetty-port-update.xsl"> <param name="customPort" expression="${jetty.https.port}"/> - </xslt> - <move - file="${build.dir}/sade/tools/jetty/etc/jetty-ssl-tmp.xml" - tofile="${build.dir}/sade/tools/jetty/etc/jetty-ssl.xml"/> - - <xslt - in="${build.dir}/sade/tools/jetty/etc/jetty.xml" - out="${build.dir}/sade/tools/jetty/etc/jetty-tmp.xml" - style="jetty-port-update.xsl"> + </xslt-inplace> + + <xslt-inplace + input="${build.dir}/sade/tools/jetty/etc/jetty.xml" + stylesheet="${resources.dir}/jetty-port-update.xsl"> <param name="customPort" expression="${jetty.https.port}"/> - </xslt> - <move - file="${build.dir}/sade/tools/jetty/etc/jetty-tmp.xml" - tofile="${build.dir}/sade/tools/jetty/etc/jetty.xml"/> + </xslt-inplace> <echo>Jetty HTTP port is set to ${jetty.http.port}.</echo> <echo>Jetty HTTPS port is set to ${jetty.https.port}.</echo> @@ -138,20 +127,15 @@ <target name="configure-xinclude-handling" depends="prepare-dist-dir"> - <xslt - in="${build.dir}/sade/conf.xml" - out="${build.dir}/sade/conf-tmp.xml" - style="configure-xinclude-handling.xsl"> + <xslt-inplace + input="${build.dir}/sade/conf.xml" + stylesheet="${resources.dir}/configure-xinclude-handling.xsl"> <param name="configParam" expression="${exist.enable-xinclude}"/> - </xslt> - <move - file="${build.dir}/sade/conf-tmp.xml" - tofile="${build.dir}/sade/conf.xml"/> + </xslt-inplace> <echo>Are XIncludes expanded automatically? ${exist.enable-xinclude}.</echo> </target> - <target name="prepare-dist-dir" depends="exist-dist-conf"> <delete dir="${build.dir}/sade"/> <!-- get updated xars to autodeploy dir --> @@ -321,6 +305,23 @@ </sequential> </macrodef> + <macrodef name="xslt-inplace"> + <attribute name="input"/> + <attribute name="stylesheet"/> + <element name="param" optional="yes"/> + <sequential> + <xslt + in="@{input}" + out="@{input}.tmp" + style="@{stylesheet}"> + <param /> + </xslt> + <move + file="@{input}.tmp" + tofile="@{input}"/> + </sequential> + </macrodef> + <macrodef name="git"> <attribute name="repo"/> <attribute name="branch"/> diff --git a/configure-xinclude-handling.xsl b/resources/configure-xinclude-handling.xsl similarity index 100% rename from configure-xinclude-handling.xsl rename to resources/configure-xinclude-handling.xsl diff --git a/jetty-port-update.xsl b/resources/jetty-port-update.xsl similarity index 100% rename from jetty-port-update.xsl rename to resources/jetty-port-update.xsl -- GitLab From 7fbbdae2051598235ea995015c004a7b4315982e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 09:19:19 +0100 Subject: [PATCH 21/32] prepare conf.xml with XSLT --- generic.xml | 83 ++++++--------------- resources/configure-backup.xsl | 26 +++++++ resources/configure-startupTrigger.xsl | 17 +++++ resources/configure-whitespace-preserve.xsl | 18 +++++ 4 files changed, 82 insertions(+), 62 deletions(-) create mode 100644 resources/configure-backup.xsl create mode 100644 resources/configure-startupTrigger.xsl create mode 100644 resources/configure-whitespace-preserve.xsl diff --git a/generic.xml b/generic.xml index fad4a0f..96ae5e1 100644 --- a/generic.xml +++ b/generic.xml @@ -16,78 +16,37 @@ <format property="timestamp" pattern="yyyyMMddHHmmss" unit="hour"/> </tstamp> - <target name="build" depends="ant-dependencies, artifact-cleanup, sade, dashboard, junit-ant-patch, sade-assets, sade-search, undo-junit-ant-patch, jetty-port, sade-memory"/> + <target name="build" depends="ant-dependencies, artifact-cleanup, exist, sade, dashboard, junit-ant-patch, sade-assets, sade-search, jetty-port, sade-memory"/> - <target name="exist-git" depends="ant-dependencies"> + <target name="exist" depends="ant-dependencies"> + <echo message="loading eXist" /> <mkdir dir="${build.dir}"/> <get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${exist.version}.tar.bz2" dest="${build.dir}/eXist-${exist.version}.tar.bz2" skipexisting="true" quiet="true" /> <untar src="${build.dir}/eXist-${exist.version}.tar.bz2" dest="${exist.dest}" compression="bzip2"> <cutdirsmapper dirs="1" /> </untar> - </target> - - <target name="exist-build-conf" depends="exist-git, junit-ant-patch"> - <echo message="configuring eXist"/> - <echo message="patching lucene inlining"/> - <patch patchfile="${resources.dir}/lucene-inline.patch" - originalfile="${exist.dest}/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java" - ignorewhitespace="true" failonerror="false"/> - <copy file="${exist.dest}/build.properties" tofile="${exist.dest}/local.build.properties" /> - <replace file="${exist.dest}/local.build.properties" token="dashboard,shared,eXide,monex" - value="dashboard,shared,eXide,monex,functx,fundocs,markdown"/> - </target> - <target name="exist-build" depends="exist-build-conf"> - <!-- using ant from eXist distribution --> - <first id="antjar"> - <fileset dir="${exist.dest}/tools/ant" includes="**/ant-launcher-*.jar" /> - </first> - <java classname="org.apache.tools.ant.launch.Launcher" fork="true"> - <arg value="-Dant.home=${exist.dest}/tools/ant"/> - <arg value="-Dant.library.dir=${exist.dest}/tools/ant/lib"/> - <arg value="-Divy.default.ivy.user.dir=${basedir}/ivy"/> - <arg - value="-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl"/> - <arg value="-f"/> - <arg value="${exist.dest}/build.xml"/> - <arg value="all"/> - <arg value="dist"/> - <classpath> - <pathelement location="${toString:antjar}"/> - <!--pathelement path="${java.class.path}"/--> - </classpath> - </java> + <echo message="loading dependencies to autodeploy"/> + <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=markdown&processor=${exist.version}" dest="${exist.dest}/autodeploy/markdown-latest.xar" ignoreerrors="true"/> + <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=functx&processor=${exist.version}" dest="${exist.dest}/autodeploy/functx-latest.xar" ignoreerrors="true"/> + <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=fundocs&processor=${exist.version}" dest="${exist.dest}/autodeploy/fundocs-latest.xar" ignoreerrors="true"/> </target> - <target name="exist-dist-conf" depends="exist-build"> + + <target name="exist-dist-conf"> <!-- enable autostart scripts --> - <replace file="${exist.dist}/conf.xml"> - <replacetoken><!--<trigger - class="org.exist.collections.triggers.XQueryStartupTrigger"/>--></replacetoken> - <replacevalue><trigger - class="org.exist.collections.triggers.XQueryStartupTrigger"/></replacevalue> - </replace> - <replace file="${exist.dist}/conf.xml"> - <replacetoken>preserve-whitespace-mixed-content="no"</replacetoken> - <replacevalue>preserve-whitespace-mixed-content="yes"</replacevalue> - </replace> + <xslt-inplace + input="${exist.dist}/conf.xml" + stylesheet="${resource.dir}/configure-startupTrigger.xsl" /> - <!-- set backup settings --> - <replace file="${exist.dist}/conf.xml"> - <replacetoken></scheduler></replacetoken> - <replacevalue><job type="system" name="check1" - class="org.exist.storage.ConsistencyCheckTask" - cron-trigger="0 0 23 * * ?"> - <parameter name="output" value="export"/> - <parameter name="backup" value="yes"/> - <parameter name="incremental" value="no"/> - <parameter name="incremental-check" value="no"/> - <parameter name="zip" value="yes"/> - <parameter name="max" value="2"/> - </job> - </scheduler></replacevalue> - </replace> + <xslt-inplace + input="${exist.dist}/conf.xml" + stylesheet="${resource.dir}/configure-whitespace-preserve.xsl" /> + <!-- set backup settings --> + <xslt-inplace + input="${exist.dist}/conf.xml" + stylesheet="${resource.dir}/configure-backup.xsl" /> </target> <target name="sade-memory" depends="exist-dist-conf"> @@ -193,10 +152,10 @@ <target name="dashboard" depends="sade"> <ant antfile="${build.dir}/sade/extensions/betterform/build.xml" target="patchWebXml" inheritAll="false"/> </target> - <target name="junit-ant-patch" depends="exist-git"> + <target name="junit-ant-patch" depends="exist"> <patch patchfile="${resources.dir}/ant-junit-basedir.patch" dir="${exist.dest}" strip="1"/> </target> - <target name="undo-junit-ant-patch" depends="exist-build"> + <target name="undo-junit-ant-patch"> <patch reverse="yes" patchfile="${resources.dir}/ant-junit-basedir.patch" dir="${exist.dest}" strip="1"/> </target> diff --git a/resources/configure-backup.xsl b/resources/configure-backup.xsl new file mode 100644 index 0000000..15a721a --- /dev/null +++ b/resources/configure-backup.xsl @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> + <xsl:param name="configParam"/> + + <xsl:template match="@* | node()"> + <xsl:copy> + <xsl:apply-templates select="@* | node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="scheduler"> + <xsl:apply-templates /> + <job type="system" name="check1" + class="org.exist.storage.ConsistencyCheckTask" + cron-trigger="0 0 23 * * ?"> + <parameter name="output" value="export"/> + <parameter name="backup" value="yes"/> + <parameter name="incremental" value="no"/> + <parameter name="incremental-check" value="no"/> + <parameter name="zip" value="yes"/> + <parameter name="max" value="2"/> + </job> + </xsl:template> + +</xsl:stylesheet> diff --git a/resources/configure-startupTrigger.xsl b/resources/configure-startupTrigger.xsl new file mode 100644 index 0000000..cbedd4e --- /dev/null +++ b/resources/configure-startupTrigger.xsl @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> + <xsl:param name="configParam"/> + + <xsl:template match="@* | node()"> + <xsl:copy> + <xsl:apply-templates select="@* | node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="triggers"> + <xsl:apply-templates /> + <trigger class="org.exist.collections.triggers.XQueryStartupTrigger"/> + </xsl:template> + +</xsl:stylesheet> diff --git a/resources/configure-whitespace-preserve.xsl b/resources/configure-whitespace-preserve.xsl new file mode 100644 index 0000000..bffcac3 --- /dev/null +++ b/resources/configure-whitespace-preserve.xsl @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> + <xsl:param name="configParam"/> + + <xsl:template match="@* | node()"> + <xsl:copy> + <xsl:apply-templates select="@* | node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="@preserve-whitespace-mixed-content"> + <xsl:attribute name="preserve-whitespace-mixed-content"> + <xsl:value-of select="yes"/> + </xsl:attribute> + </xsl:template> + +</xsl:stylesheet> -- GitLab From ae188a6bb2c3eeec38aee66ebbcabea67c8790e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 09:47:48 +0100 Subject: [PATCH 22/32] refactored build process MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * increased usage of xslt (update-safe) * remove usage of eXist's “dist†target (ant) * fix xinclude xslt --- generic.build.properties | 1 - generic.xml | 25 +++++++------------ resources/configure-backup.xsl | 27 +++++++++++---------- resources/configure-startupTrigger.xsl | 9 ++++--- resources/configure-whitespace-preserve.xsl | 3 +-- resources/configure-xinclude-handling.xsl | 6 ++--- 6 files changed, 32 insertions(+), 39 deletions(-) diff --git a/generic.build.properties b/generic.build.properties index d0f9e5c..28051fc 100644 --- a/generic.build.properties +++ b/generic.build.properties @@ -14,7 +14,6 @@ exist.git=https\://github.com/eXist-db/exist.git exist.version=4.5.0 exist.tag=eXist-${exist.version} exist.dest=${build.dir}/exist -exist.dist=${exist.dest}/dist/eXist-db-${exist.version} exist.memory=2048 exist.enable-xinclude=false diff --git a/generic.xml b/generic.xml index 96ae5e1..9382343 100644 --- a/generic.xml +++ b/generic.xml @@ -36,17 +36,18 @@ <target name="exist-dist-conf"> <!-- enable autostart scripts --> <xslt-inplace - input="${exist.dist}/conf.xml" - stylesheet="${resource.dir}/configure-startupTrigger.xsl" /> + input="${exist.dest}/conf.xml" + stylesheet="${resources.dir}/configure-startupTrigger.xsl" /> + <!-- enable startup trigger --> <xslt-inplace - input="${exist.dist}/conf.xml" - stylesheet="${resource.dir}/configure-whitespace-preserve.xsl" /> + input="${exist.dest}/conf.xml" + stylesheet="${resources.dir}/configure-whitespace-preserve.xsl" /> <!-- set backup settings --> <xslt-inplace - input="${exist.dist}/conf.xml" - stylesheet="${resource.dir}/configure-backup.xsl" /> + input="${exist.dest}/conf.xml" + stylesheet="${resources.dir}/configure-backup.xsl" /> </target> <target name="sade-memory" depends="exist-dist-conf"> @@ -97,18 +98,10 @@ <target name="prepare-dist-dir" depends="exist-dist-conf"> <delete dir="${build.dir}/sade"/> - <!-- get updated xars to autodeploy dir --> - <delete dir="${exist.dist}/autodeploy"/> - <mkdir dir="${exist.dist}/autodeploy"/> - <move2autodeploy source="${exist.dest}/autodeploy/"/> - - <copy todir="${build.dir}/sade/lib/test"> - <fileset dir="${exist.dest}/lib/test"/> - </copy> <!-- move eXist to the SADE path --> <mkdir dir="${build.dir}/sade"/> - <move file="${exist.dist}" tofile="${build.dir}/sade" overwrite="true"/> + <move file="${exist.dest}" tofile="${build.dir}/sade" overwrite="true"/> <!-- undo changes to tracked files, so git pull is possible…--> <patch reverse="true" patchfile="${resources.dir}/lucene-inline.patch" originalfile="${exist.dest}/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java" @@ -267,7 +260,7 @@ <macrodef name="xslt-inplace"> <attribute name="input"/> <attribute name="stylesheet"/> - <element name="param" optional="yes"/> + <element name="param" optional="yes" implicit="true"/> <sequential> <xslt in="@{input}" diff --git a/resources/configure-backup.xsl b/resources/configure-backup.xsl index 15a721a..18c568b 100644 --- a/resources/configure-backup.xsl +++ b/resources/configure-backup.xsl @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> - <xsl:param name="configParam"/> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/> <xsl:template match="@* | node()"> <xsl:copy> @@ -10,17 +9,19 @@ </xsl:template> <xsl:template match="scheduler"> - <xsl:apply-templates /> - <job type="system" name="check1" - class="org.exist.storage.ConsistencyCheckTask" - cron-trigger="0 0 23 * * ?"> - <parameter name="output" value="export"/> - <parameter name="backup" value="yes"/> - <parameter name="incremental" value="no"/> - <parameter name="incremental-check" value="no"/> - <parameter name="zip" value="yes"/> - <parameter name="max" value="2"/> - </job> + <scheduler> + <xsl:apply-templates /> + <job type="system" name="check1" + class="org.exist.storage.ConsistencyCheckTask" + cron-trigger="0 0 23 * * ?"> + <parameter name="output" value="export"/> + <parameter name="backup" value="yes"/> + <parameter name="incremental" value="no"/> + <parameter name="incremental-check" value="no"/> + <parameter name="zip" value="yes"/> + <parameter name="max" value="2"/> + </job> + </scheduler> </xsl:template> </xsl:stylesheet> diff --git a/resources/configure-startupTrigger.xsl b/resources/configure-startupTrigger.xsl index cbedd4e..269cd5e 100644 --- a/resources/configure-startupTrigger.xsl +++ b/resources/configure-startupTrigger.xsl @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> - <xsl:param name="configParam"/> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/> <xsl:template match="@* | node()"> <xsl:copy> @@ -10,8 +9,10 @@ </xsl:template> <xsl:template match="triggers"> - <xsl:apply-templates /> - <trigger class="org.exist.collections.triggers.XQueryStartupTrigger"/> + <triggers> + <xsl:apply-templates /> + <trigger class="org.exist.collections.triggers.XQueryStartupTrigger"/> + </triggers> </xsl:template> </xsl:stylesheet> diff --git a/resources/configure-whitespace-preserve.xsl b/resources/configure-whitespace-preserve.xsl index bffcac3..7fc68e8 100644 --- a/resources/configure-whitespace-preserve.xsl +++ b/resources/configure-whitespace-preserve.xsl @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> - <xsl:param name="configParam"/> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" /> <xsl:template match="@* | node()"> <xsl:copy> diff --git a/resources/configure-xinclude-handling.xsl b/resources/configure-xinclude-handling.xsl index 0388aa3..5ce6e99 100644 --- a/resources/configure-xinclude-handling.xsl +++ b/resources/configure-xinclude-handling.xsl @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" doctype-public="-//Jetty//Configure//EN" doctype-system="http://www.eclipse.org/jetty/configure_9_3.dtd"/> + <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" /> <xsl:param name="configParam"/> - + <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> - + <xsl:template match="@enable-xinclude"> <xsl:attribute name="enable-xinclude"> <xsl:choose> -- GitLab From d043e9b0981ea82e663bc72b6a6443fb448f5eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 10:08:11 +0100 Subject: [PATCH 23/32] use develop specific dependencies and reset to master at CI --- .gitlab-ci.yml | 18 ++++++++++++++++-- generic-master.build.properties | 7 +++++++ generic-test.sh | 20 -------------------- generic.build.properties | 2 +- generic.xml | 14 ++++++++------ 5 files changed, 32 insertions(+), 29 deletions(-) create mode 100644 generic-master.build.properties delete mode 100755 generic-test.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ae42d2..0eb2dd5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,8 +20,22 @@ variables: build: stage: build + except: + - master + script: + # cleanup - just in case there is something cached + - ant -f generic.xml artifact-cleanup + - ant -f generic.xml + artifacts: + paths: + - build/sade/ +build: + stage: build + only: + - master script: -# cleanup - just in case there is something cached + - mv generic-master.build.properties local.build.properties + # cleanup - just in case there is something cached - ant -f generic.xml artifact-cleanup - ant -f generic.xml artifacts: @@ -34,7 +48,7 @@ test-basic: - build script: - DIR="$(pwd)" -# remove an old testlogfile + # remove an old testlogfile - mv build/sade /opt/ - bash '/opt/sade/bin/startup.sh' & - while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 2s; done diff --git a/generic-master.build.properties b/generic-master.build.properties new file mode 100644 index 0000000..036f220 --- /dev/null +++ b/generic-master.build.properties @@ -0,0 +1,7 @@ +#Thu, 29 Jun 2017 12:22:45 +0200 + +# SADE configuration +sade.branch=master + +# SADE Assets configuration +sade-assets.branch=master diff --git a/generic-test.sh b/generic-test.sh deleted file mode 100755 index 5512a8f..0000000 --- a/generic-test.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -# test to parse XQSuite -# for details see http://exist-db.org/exist/apps/doc/xqsuite.xml -# -# everything should end with no failures. -# the post-install.xq - responsible to execute the tests under certain -# conditions, writes a "fail" in the resulting documents. - -TEST=$(grep --invert-match 'failures="0"' build/sade_job-*.xml) -TEST=$(grep --no-filename --only-matching --extended-regexp \ - "failures=\"[0-9]+\"" build/sade_job-*.xml \ - | grep --only-matching --extended-regexp "[0-9]+" \ - | paste -sd+ \ - | bc ) -if [ "$TEST" -ne "1" ] - then - echo "there are failing tests."; exit 1 - else - echo "no failures found. good."; exit 0 -fi diff --git a/generic.build.properties b/generic.build.properties index 28051fc..b0f567d 100644 --- a/generic.build.properties +++ b/generic.build.properties @@ -37,7 +37,7 @@ code-viewer.install=false # Search Index Module, currently maven builded by CI, so only a # URL to the preffered build is needed -sade-search.build=https\://ci.de.dariah.eu/exist-repo/public/fontane-lucene-exist-module-2.0.2.xar +sade-search.build=http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=fontane-lucene-exist-module&processor=${exist.version} sade-search.dest=${build.dir}/expkg-search # debian package diff --git a/generic.xml b/generic.xml index 9382343..71546c5 100644 --- a/generic.xml +++ b/generic.xml @@ -2,12 +2,12 @@ <project xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:git="antlib:com.rimerosolutions.ant.git" basedir="." name="SADE" - default="build"> + default="sade"> <description> builds a generic version of SADE, customizable by projects via own parameter injection. built packages should be moved to autodeploy directory by their targets! </description> - <property file="local.generic.build.properties" /> + <property file="local.build.properties" /> <property file="generic.build.properties" /> <property name="ivy.jardir" value="${basedir}/lib"/> @@ -16,7 +16,9 @@ <format property="timestamp" pattern="yyyyMMddHHmmss" unit="hour"/> </tstamp> - <target name="build" depends="ant-dependencies, artifact-cleanup, exist, sade, dashboard, junit-ant-patch, sade-assets, sade-search, jetty-port, sade-memory"/> + <target name="sade" depends="ant-dependencies, artifact-cleanup, exist, sade, dashboard, junit-ant-patch, sade-assets, sade-search, jetty-port, sade-memory"/> + + <target name="exist" depends="exist-load, exist-conf" <target name="exist" depends="ant-dependencies"> <echo message="loading eXist" /> @@ -33,7 +35,7 @@ <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=fundocs&processor=${exist.version}" dest="${exist.dest}/autodeploy/fundocs-latest.xar" ignoreerrors="true"/> </target> - <target name="exist-dist-conf"> + <target name="exist-conf"> <!-- enable autostart scripts --> <xslt-inplace input="${exist.dest}/conf.xml" @@ -96,7 +98,7 @@ <echo>Are XIncludes expanded automatically? ${exist.enable-xinclude}.</echo> </target> - <target name="prepare-dist-dir" depends="exist-dist-conf"> + <target name="prepare-dist-dir" depends="exist"> <delete dir="${build.dir}/sade"/> <!-- move eXist to the SADE path --> @@ -124,7 +126,7 @@ <target name="sade-search" depends="prepare-dist-dir"> <mkdir dir="${sade-search.dest}"/> - <get src="${sade-search.build}" dest="${sade-search.dest}"/> + <get src="${sade-search.build}" dest="${sade-search.dest}/fontane-lucene-exist-module-latest.xar"/> <move2autodeploy source="${sade-search.dest}"/> </target> -- GitLab From 1331691c66706eb5431757172d59d01b62378a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 11:18:32 +0100 Subject: [PATCH 24/32] moving from git to get --- architrave.xml | 4 +- generic.build.properties | 4 +- generic.xml | 399 +++++++++++++++------------------------ 3 files changed, 158 insertions(+), 249 deletions(-) diff --git a/architrave.xml b/architrave.xml index 81fe1ad..398df86 100644 --- a/architrave.xml +++ b/architrave.xml @@ -5,8 +5,8 @@ xmlns:git="antlib:com.rimerosolutions.ant.git"> <property file="architrave.build.properties"/> - + <property file="generic.build.properties"/> <import file="generic.xml"/> - + </project> diff --git a/generic.build.properties b/generic.build.properties index b0f567d..5358537 100644 --- a/generic.build.properties +++ b/generic.build.properties @@ -14,7 +14,7 @@ exist.git=https\://github.com/eXist-db/exist.git exist.version=4.5.0 exist.tag=eXist-${exist.version} exist.dest=${build.dir}/exist -exist.memory=2048 +exist.memory=2048m exist.enable-xinclude=false # Jetty port configuration @@ -37,7 +37,7 @@ code-viewer.install=false # Search Index Module, currently maven builded by CI, so only a # URL to the preffered build is needed -sade-search.build=http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=fontane-lucene-exist-module&processor=${exist.version} +sade-search.abbrev=fontane-lucene-exist-module sade-search.dest=${build.dir}/expkg-search # debian package diff --git a/generic.xml b/generic.xml index 71546c5..940bfa8 100644 --- a/generic.xml +++ b/generic.xml @@ -2,25 +2,25 @@ <project xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:git="antlib:com.rimerosolutions.ant.git" basedir="." name="SADE" - default="sade"> + default="build"> - <description> builds a generic version of SADE, customizable by projects via own parameter - injection. built packages should be moved to autodeploy directory by their targets! </description> + <description> + builds a generic version of SADE, customizable by projects via own + parameter injection. built packages should be moved to autodeploy + directory by their targets! + </description> <property file="local.build.properties" /> <property file="generic.build.properties" /> - <property name="ivy.jardir" value="${basedir}/lib"/> - <tstamp> <format property="timestamp" pattern="yyyyMMddHHmmss" unit="hour"/> </tstamp> - <target name="sade" depends="ant-dependencies, artifact-cleanup, exist, sade, dashboard, junit-ant-patch, sade-assets, sade-search, jetty-port, sade-memory"/> - - <target name="exist" depends="exist-load, exist-conf" + <target name="build" depends="artifact-cleanup, sade, sade-assets, sade-search, jetty-port, sade-memory"/> + <target name="exist" depends="exist-load, exist-conf" /> - <target name="exist" depends="ant-dependencies"> + <target name="exist-load" depends="ant-dependencies"> <echo message="loading eXist" /> <mkdir dir="${build.dir}"/> <get src="https://bintray.com/existdb/releases/download_file?file_path=eXist-db-${exist.version}.tar.bz2" @@ -30,38 +30,44 @@ </untar> <echo message="loading dependencies to autodeploy"/> - <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=markdown&processor=${exist.version}" dest="${exist.dest}/autodeploy/markdown-latest.xar" ignoreerrors="true"/> - <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=functx&processor=${exist.version}" dest="${exist.dest}/autodeploy/functx-latest.xar" ignoreerrors="true"/> - <get src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=fundocs&processor=${exist.version}" dest="${exist.dest}/autodeploy/fundocs-latest.xar" ignoreerrors="true"/> + <get + src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=markdown&processor=${exist.version}" + dest="${exist.dest}/autodeploy/markdown-latest.xar" ignoreerrors="true"/> + <get + src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=functx&processor=${exist.version}" + dest="${exist.dest}/autodeploy/functx-latest.xar" ignoreerrors="true"/> + <get + src="http://exist-db.org/exist/apps/public-repo/find.zip?abbrev=fundocs&processor=${exist.version}" + dest="${exist.dest}/autodeploy/fundocs-latest.xar" ignoreerrors="true"/> </target> <target name="exist-conf"> - <!-- enable autostart scripts --> - <xslt-inplace - input="${exist.dest}/conf.xml" - stylesheet="${resources.dir}/configure-startupTrigger.xsl" /> - - <!-- enable startup trigger --> - <xslt-inplace - input="${exist.dest}/conf.xml" - stylesheet="${resources.dir}/configure-whitespace-preserve.xsl" /> - - <!-- set backup settings --> - <xslt-inplace - input="${exist.dest}/conf.xml" - stylesheet="${resources.dir}/configure-backup.xsl" /> + <!-- enable autostart scripts --> + <xslt-inplace + input="${exist.dest}/conf.xml" + stylesheet="${resources.dir}/configure-startupTrigger.xsl" /> + + <!-- enable startup trigger --> + <xslt-inplace + input="${exist.dest}/conf.xml" + stylesheet="${resources.dir}/configure-whitespace-preserve.xsl" /> + + <!-- set backup settings --> + <xslt-inplace + input="${exist.dest}/conf.xml" + stylesheet="${resources.dir}/configure-backup.xsl" /> </target> - <target name="sade-memory" depends="exist-dist-conf"> + <target name="sade-memory" depends="exist-conf"> <replace file="${build.dir}/sade/bin/functions.d/eXist-settings.sh" token="Xmx2048m" - value="Xmx${exist.memory}m"/> + value="Xmx${exist.memory}"/> <echo>Total memory available for SADE's eXist-db: ${exist.memory}.</echo> </target> <!-- Port configuration --> - <target name="jetty-port" depends="prepare-dist-dir"> + <target name="jetty-port" depends="prepare-sade-dir"> <!-- HTTP port --> <xslt-inplace input="${build.dir}/sade/tools/jetty/etc/jetty-http.xml" @@ -69,7 +75,6 @@ <param name="customPort" expression="${jetty.http.port}"/> </xslt-inplace> - <!-- HTTPS port --> <xslt-inplace input="${build.dir}/sade/tools/jetty/etc/jetty-ssl.xml" @@ -88,46 +93,40 @@ </target> - <target name="configure-xinclude-handling" depends="prepare-dist-dir"> - <xslt-inplace - input="${build.dir}/sade/conf.xml" - stylesheet="${resources.dir}/configure-xinclude-handling.xsl"> - <param name="configParam" expression="${exist.enable-xinclude}"/> - </xslt-inplace> + <target name="configure-xinclude-handling" depends="prepare-sade-dir"> + <xslt-inplace + input="${build.dir}/sade/conf.xml" + stylesheet="${resources.dir}/configure-xinclude-handling.xsl"> + <param name="configParam" expression="${exist.enable-xinclude}"/> + </xslt-inplace> - <echo>Are XIncludes expanded automatically? ${exist.enable-xinclude}.</echo> + <echo>Are XIncludes expanded automatically? ${exist.enable-xinclude}.</echo> </target> - <target name="prepare-dist-dir" depends="exist"> - <delete dir="${build.dir}/sade"/> + <target name="prepare-sade-dir" depends="exist"> + <delete dir="${build.dir}/sade"/> - <!-- move eXist to the SADE path --> - <mkdir dir="${build.dir}/sade"/> - <move file="${exist.dest}" tofile="${build.dir}/sade" overwrite="true"/> - <!-- undo changes to tracked files, so git pull is possible…--> - <patch reverse="true" patchfile="${resources.dir}/lucene-inline.patch" - originalfile="${exist.dest}/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java" - ignorewhitespace="true" failonerror="false"/> + <!-- move eXist to the SADE path --> + <mkdir dir="${build.dir}/sade"/> + <move file="${exist.dest}" tofile="${build.dir}/sade" overwrite="true"/> + <!-- undo changes to tracked files, so git pull is possible…--> + <patch reverse="true" patchfile="${resources.dir}/lucene-inline.patch" + originalfile="${exist.dest}/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java" + ignorewhitespace="true" failonerror="false"/> </target> <!-- SADE --> - <target name="sade" depends="prepare-dist-dir, sade-assets, sade-memory, jetty-port, configure-xinclude-handling, code-viewer"> - <git repo="${sade.git}" branch="${sade.branch}" dest="${sade.dest}"/> - <ant antfile="${sade.dest}/build.xml" inheritAll="false"/> - <move2autodeploy source="${sade.dest}/build/"/> - </target> + <target name="sade" depends="prepare-sade-dir, sade-assets, sade-memory, jetty-port, configure-xinclude-handling"> + <!-- assets --> + <get + src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=sade_assets&processor=${exist.version}" + dest="${build.dir}/sade/autodeploy/sade_assets-latest.xar" ignoreerrors="true"/> - <!-- SADE Assets --> - <target name="sade-assets" depends="prepare-dist-dir"> - <git repo="${sade-assets.git}" branch="${sade-assets.branch}" dest="${sade-assets.dest}"/> - <ant antfile="${sade-assets.dest}/build.xml" inheritAll="false"/> - <move2autodeploy source="${sade-assets.dest}/build/"/> - </target> + <!-- search --> + <get + src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${sade-search.abbrev}&processor=${exist.version}" + dest="${build.dir}/sade/autodeploy/fontane_lucene_exist_module-latest.xar"/> - <target name="sade-search" depends="prepare-dist-dir"> - <mkdir dir="${sade-search.dest}"/> - <get src="${sade-search.build}" dest="${sade-search.dest}/fontane-lucene-exist-module-latest.xar"/> - <move2autodeploy source="${sade-search.dest}"/> </target> <!-- SADE Code viewer --> @@ -154,109 +153,78 @@ <patch reverse="yes" patchfile="${resources.dir}/ant-junit-basedir.patch" dir="${exist.dest}" strip="1"/> </target> - <target name="build-debian-package" depends="ant-dependencies, artifact-cleanup, sade, dashboard, junit-ant-patch, sade-assets, sade-search"> - <property name="deb.archive.file" value="${build.dir}/${deb.name}_${version}-${timestamp}.tar.gz" /> - <property name="deb.version" value="${version}-${timestamp}" /> - - <!-- https://github.com/tcurdt/jdeb/blob/master/docs/ant.md --> - <copy todir="${build.dir}/deb/control"> - <fileset dir="resources/deb/${deb.name}/control"/> - <filterset begintoken="[[" endtoken="]]"> - <filter token="version" value="${deb.version}"/> - <filter token="description" value="${deb.description}"/> - <filter token="name" value="${deb.name}"/> - </filterset> - </copy> - - <copy file="${deb.initfile.src}" tofile="${build.dir}/sade/bin/sade.init.sh" /> - <exec executable="chmod"> - <arg value="755"/> - <arg value="${build.dir}/sade/bin/sade.init.sh"/> - </exec> - - <tar destfile="${deb.archive.file}" compression="gzip" longfile="gnu"> - <tarfileset dir="${build.dir}/sade" filemode="755" username="${deb.name}" group="${deb.name}"> - <include name="**/*.sh"/> - </tarfileset> - <tarfileset dir="${build.dir}/sade" includes="**" username="${deb.name}" group="${deb.name}"> - <exclude name="**/*.sh"/> - </tarfileset> - </tar> - - <deb destfile="${build.dir}/${deb.name}_${deb.version}.deb" control="${build.dir}/deb/control" verbose="false" > - <data src="${deb.archive.file}" type="archive"> - <mapper type="perm" prefix="/opt/${deb.name}"/> - </data> - </deb> - <delete file="${deb.archive.file}" /> + <target name="debian-package" depends="ant-dependencies, artifact-cleanup, sade, sade-assets, sade-search"> + <property name="deb.archive.file" value="${build.dir}/${deb.name}_${version}-${timestamp}.tar.gz" /> + <property name="deb.version" value="${version}-${timestamp}" /> + + <!-- https://github.com/tcurdt/jdeb/blob/master/docs/ant.md --> + <copy todir="${build.dir}/deb/control"> + <fileset dir="resources/deb/${deb.name}/control"/> + <filterset begintoken="[[" endtoken="]]"> + <filter token="version" value="${deb.version}"/> + <filter token="description" value="${deb.description}"/> + <filter token="name" value="${deb.name}"/> + </filterset> + </copy> + + <copy file="${deb.initfile.src}" tofile="${build.dir}/sade/bin/sade.init.sh" /> + <exec executable="chmod"> + <arg value="755"/> + <arg value="${build.dir}/sade/bin/sade.init.sh"/> + </exec> + + <tar destfile="${deb.archive.file}" compression="gzip" longfile="gnu"> + <tarfileset dir="${build.dir}/sade" filemode="755" username="${deb.name}" group="${deb.name}"> + <include name="**/*.sh"/> + </tarfileset> + <tarfileset dir="${build.dir}/sade" includes="**" username="${deb.name}" group="${deb.name}"> + <exclude name="**/*.sh"/> + </tarfileset> + </tar> + + <deb destfile="${build.dir}/${deb.name}_${deb.version}.deb" control="${build.dir}/deb/control" verbose="false" > + <data src="${deb.archive.file}" type="archive"> + <mapper type="perm" prefix="/opt/${deb.name}"/> + </data> + </deb> + <delete file="${deb.archive.file}" /> </target> <target name="tar-gz-artifact" depends="artifact-cleanup"> - <tar destfile="${build.dir}/sade-${version}.tar.gz" compression="gzip" longfile="gnu"> - <tarfileset dir="${build.dir}/sade" filemode="755"> - <include name="**/*.sh"/> - </tarfileset> - <tarfileset dir="${build.dir}/sade" includes="**"> - <exclude name="**/*.sh"/> - </tarfileset> - </tar> + <tar destfile="${build.dir}/sade-${version}.tar.gz" compression="gzip" longfile="gnu"> + <tarfileset dir="${build.dir}/sade" filemode="755"> + <include name="**/*.sh"/> + </tarfileset> + <tarfileset dir="${build.dir}/sade" includes="**"> + <exclude name="**/*.sh"/> + </tarfileset> + </tar> </target> + <target name="artifact-cleanup"> - <delete dir="${build.dir}/deb" failonerror="false"/> - <delete failonerror="false"> - <fileset dir="${build.dir}"> - <include name="*.deb"/> - <include name="*.changes"/> - <include name="sade*.tar.gz"/> - </fileset> - </delete> + <delete dir="${build.dir}/deb" failonerror="false"/> + <delete failonerror="false"> + <fileset dir="${build.dir}"> + <include name="*.deb"/> + <include name="*.changes"/> + <include name="sade*.tar.gz"/> + </fileset> + </delete> </target> <!-- ************************************* --> - <!-- * ALL DEPENDENCIES BELOW THIS LINE! * --> + <!-- * ALL MACROS BELOW THIS LINE! * --> <!-- ************************************* --> - <target name="ant-dependencies" depends="install-ivy"> - <property name="ivy.default.ivy.user.dir" value="${basedir}/ivy"/> - <ivy:retrieve conf="tasks"/> - <path id="classpath"> - <fileset dir="./lib"> - <include name="*.jar"/> - </fileset> - </path> - <!-- git --> - <taskdef uri="antlib:com.rimerosolutions.ant.git" - resource="com/rimerosolutions/ant/git/jgit-ant-lib.xml" classpathref="classpath"/> - <!-- contrib has if --> - <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="classpath"/> - <!-- jdeb --> - <taskdef name="deb" classname="org.vafer.jdeb.ant.DebAntTask" classpathref="classpath"/> - </target> - - <target name="download-ivy" unless="skip.download"> - <mkdir dir="${ivy.jardir}"/> - <get - src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" - dest="${ivy.jarfile}" usetimestamp="true"/> - </target> - - <target name="install-ivy" depends="download-ivy" description="installs ivy"> - <path id="ivy.lib.path"> - <pathelement location="${ivy.jarfile}"/> - </path> - <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" - classpathref="ivy.lib.path"/> - </target> - <macrodef name="move2autodeploy"> - <attribute name="source"/> - <sequential> - <move todir="${build.dir}/sade/autodeploy/"> - <fileset dir="@{source}"> - <include name="*.xar"/> - </fileset> - </move> - </sequential> + <attribute name="source"/> + <sequential> + <move todir="${build.dir}/sade/autodeploy/"> + <fileset dir="@{source}"> + <include name="*.xar"/> + </fileset> + </move> + </sequential> </macrodef> <macrodef name="xslt-inplace"> @@ -276,98 +244,39 @@ </sequential> </macrodef> - <macrodef name="git"> - <attribute name="repo"/> - <attribute name="branch"/> - <attribute name="dest"/> - <sequential> - <if> - <available file="@{dest}" type="dir"/> - <then> - <echo message="updating @{dest} from @{repo}"/> - <if> - <matches string="@{branch}" pattern="^tags/.*" /> - <then> - <echo message="checking out tag: @{branch}"/> - <git:git directory="@{dest}" verbose="false"> - <git:fetch uri="@{repo}" /> - <git:checkout branchname="@{branch}" failonerror="true"/> - </git:git> - </then> - <else> - <echo message="pulling from branch: @{branch}"/> - <git-branch-checkout-pull repo="@{repo}" branch="@{branch}" dest="@{dest}"/> - </else> - </if> - </then> - <else> - <if> - <matches string="@{branch}" pattern="^tags/.*" /> - <then> - <echo message="cloning @{repo} and checkout tag"/> - <git:git directory="@{dest}" verbose="false"> - <git:clone uri="@{repo}"/> - <git:checkout branchname="@{branch}"/> - </git:git> - </then> - <else> - <echo message="cloning @{repo} to @{dest}"/> - <git:git directory="@{dest}" verbose="false"> - <git:clone uri="@{repo}" branchtotrack="@{branch}"/> - </git:git> - </else> - </if> - </else> - </if> - </sequential> - </macrodef> + <!-- ************************************* --> + <!-- * ALL DEPENDENCIES BELOW THIS LINE! * --> + <!-- ************************************* --> + <target name="ant-dependencies" depends="install-ivy"> + <property name="ivy.default.ivy.user.dir" value="${basedir}/ivy"/> + <ivy:retrieve conf="tasks"/> + <path id="classpath"> + <fileset dir="./lib"> + <include name="*.jar"/> + </fileset> + </path> + <!-- git --> + <taskdef uri="antlib:com.rimerosolutions.ant.git" + resource="com/rimerosolutions/ant/git/jgit-ant-lib.xml" classpathref="classpath"/> + <!-- contrib has if --> + <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="classpath"/> + <!-- jdeb --> + <taskdef name="deb" classname="org.vafer.jdeb.ant.DebAntTask" classpathref="classpath"/> + </target> - <!-- the git:checkout task does not so well in checkount and setting new remote - tracking branches, the following task is a workaround --> - <macrodef name="git-branch-checkout-pull"> - <attribute name="repo"/> - <attribute name="branch"/> - <attribute name="dest"/> - <sequential> - - <git:git directory="@{dest}" verbose="false"> - <git:fetch uri="@{repo}" /> - <git:branchlist outputfilename="@{dest}/git.branches"/> - </git:git> - - <loadfile property="localBranchLine" srcfile="@{dest}/git.branches"> - <filterchain> - <linecontains> - <contains value="* @{branch}"></contains> - </linecontains> - </filterchain> - </loadfile> - - <if> - <isset property="localBranchLine"/> - <then> - <git:git directory="@{dest}" verbose="false"> - <git:checkout branchname="@{branch}" failonerror="true" /> - <git:pull uri="@{repo}" /> - </git:git> - </then> - <else> - <echo message="no local branch existing yet, create and set remote tracking"/> - <git:git directory="@{dest}" verbose="false"> - <git:checkout branchname="@{branch}" failonerror="true" createbranch="true" startpoint="@{branch}" /> - </git:git> - <echo file="@{dest}/.git/config" append="true"> - [branch "@{branch}"] - remote = origin - merge = refs/heads/@{branch} - </echo> - <git:git directory="@{dest}" verbose="false"> - <git:pull uri="@{repo}" /> - </git:git> - </else> - </if> - - </sequential> - </macrodef> + <target name="download-ivy" unless="skip.download"> + <mkdir dir="${ivy.jardir}"/> + <get + src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" + dest="${ivy.jarfile}" usetimestamp="true"/> + </target> + + <target name="install-ivy" depends="download-ivy" description="installs ivy"> + <path id="ivy.lib.path"> + <pathelement location="${ivy.jarfile}"/> + </path> + <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" + classpathref="ivy.lib.path"/> + </target> </project> -- GitLab From aa60eeb5ff69321621db9ddc10b23745bd79ae70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 11:19:37 +0100 Subject: [PATCH 25/32] cleanup --- generic.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic.xml b/generic.xml index 940bfa8..465edb2 100644 --- a/generic.xml +++ b/generic.xml @@ -153,7 +153,7 @@ <patch reverse="yes" patchfile="${resources.dir}/ant-junit-basedir.patch" dir="${exist.dest}" strip="1"/> </target> - <target name="debian-package" depends="ant-dependencies, artifact-cleanup, sade, sade-assets, sade-search"> + <target name="debian-package" depends="ant-dependencies, artifact-cleanup, sade"> <property name="deb.archive.file" value="${build.dir}/${deb.name}_${version}-${timestamp}.tar.gz" /> <property name="deb.version" value="${version}-${timestamp}" /> -- GitLab From f23207d161aa31076655d2e2795817b99688494c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 12:09:29 +0100 Subject: [PATCH 26/32] moving from git to get --- generic-master.build.properties | 7 +------ generic.build.properties | 9 ++------- generic.xml | 16 ++++++++++------ 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/generic-master.build.properties b/generic-master.build.properties index 036f220..427f613 100644 --- a/generic-master.build.properties +++ b/generic-master.build.properties @@ -1,7 +1,2 @@ -#Thu, 29 Jun 2017 12:22:45 +0200 - # SADE configuration -sade.branch=master - -# SADE Assets configuration -sade-assets.branch=master +sade.abbrev=SADE diff --git a/generic.build.properties b/generic.build.properties index 5358537..de92451 100644 --- a/generic.build.properties +++ b/generic.build.properties @@ -22,14 +22,10 @@ jetty.http.port=8080 jetty.https.port=8443 # SADE configuration -sade.git=https\://gitlab.gwdg.de/SADE/SADE.git -sade.branch=develop -sade.dest=${build.dir}/expkg-sade +sade.abbrev=SADE-develop # SADE Assets configuration -sade-assets.git=https\://gitlab.gwdg.de/SADE/assets.git -sade-assets.branch=master -sade-assets.dest=${build.dir}/expkg-sade_assets +sade-assets.abbrev=sade_assets # SADE code viewer installation # defaults to 'false'. change to 'true' to install the app. @@ -38,7 +34,6 @@ code-viewer.install=false # Search Index Module, currently maven builded by CI, so only a # URL to the preffered build is needed sade-search.abbrev=fontane-lucene-exist-module -sade-search.dest=${build.dir}/expkg-search # debian package deb.initfile.src=${resources.dir}/deb/${deb.name}/sade.init.sh diff --git a/generic.xml b/generic.xml index 465edb2..f09cee3 100644 --- a/generic.xml +++ b/generic.xml @@ -17,7 +17,7 @@ <format property="timestamp" pattern="yyyyMMddHHmmss" unit="hour"/> </tstamp> - <target name="build" depends="artifact-cleanup, sade, sade-assets, sade-search, jetty-port, sade-memory"/> + <target name="build" depends="artifact-cleanup, sade, jetty-port, sade-memory"/> <target name="exist" depends="exist-load, exist-conf" /> <target name="exist-load" depends="ant-dependencies"> @@ -92,7 +92,6 @@ <echo>Jetty HTTPS port is set to ${jetty.https.port}.</echo> </target> - <target name="configure-xinclude-handling" depends="prepare-sade-dir"> <xslt-inplace input="${build.dir}/sade/conf.xml" @@ -116,16 +115,21 @@ </target> <!-- SADE --> - <target name="sade" depends="prepare-sade-dir, sade-assets, sade-memory, jetty-port, configure-xinclude-handling"> + <target name="sade" depends="prepare-sade-dir, sade-memory, jetty-port, configure-xinclude-handling"> + <!-- SADE --> + <get + src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${sade.abbrev}&processor=${exist.version}" + dest="${build.dir}/sade/autodeploy/${sade.abbrev}-latest.xar"/> + <!-- assets --> <get - src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=sade_assets&processor=${exist.version}" - dest="${build.dir}/sade/autodeploy/sade_assets-latest.xar" ignoreerrors="true"/> + src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${sade-assets.abbrev}&processor=${exist.version}" + dest="${build.dir}/sade/autodeploy/${sade-assets.abbrev}-latest.xar"/> <!-- search --> <get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${sade-search.abbrev}&processor=${exist.version}" - dest="${build.dir}/sade/autodeploy/fontane_lucene_exist_module-latest.xar"/> + dest="${build.dir}/sade/autodeploy/${sade-search.abbrev}-latest.xar"/> </target> -- GitLab From 0ba3a40806aee83ced0945434d9175ddf6e2b7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 12:25:02 +0100 Subject: [PATCH 27/32] set dependend ant names --- generic-master.build.properties | 3 ++- generic.build.properties | 1 + generic.xml | 8 +++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/generic-master.build.properties b/generic-master.build.properties index 427f613..eb83831 100644 --- a/generic-master.build.properties +++ b/generic-master.build.properties @@ -1,2 +1,3 @@ -# SADE configuration +# master configuration sade.abbrev=SADE +code-viewer.abbrev=cv diff --git a/generic.build.properties b/generic.build.properties index de92451..604ecfa 100644 --- a/generic.build.properties +++ b/generic.build.properties @@ -29,6 +29,7 @@ sade-assets.abbrev=sade_assets # SADE code viewer installation # defaults to 'false'. change to 'true' to install the app. +code-viewer.abbrev=cv-develop code-viewer.install=false # Search Index Module, currently maven builded by CI, so only a diff --git a/generic.xml b/generic.xml index 6d2d9ac..27500dd 100644 --- a/generic.xml +++ b/generic.xml @@ -115,7 +115,7 @@ </target> <!-- SADE --> - <target name="sade" depends="prepare-sade-dir, sade-memory, jetty-port, configure-xinclude-handling"> + <target name="sade" depends="prepare-sade-dir, code-viewer, sade-memory, jetty-port, configure-xinclude-handling"> <!-- SADE --> <get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${sade.abbrev}&processor=${exist.version}" @@ -134,9 +134,11 @@ </target> <!-- SADE Code viewer --> - <target name="code-viewer" if="code-viewer.enabled" depends="prepare-dist-dir, test.if.code-viewer.is.enabled"> + <target name="code-viewer" if="code-viewer.enabled" depends="prepare-sade-dir, test.if.code-viewer.is.enabled"> <echo message="Install Code Viewer: "/> - <get src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=cv" dest="${build.dir}/sade/autodeploy/codeview-latest.xar"/> + <get + src="https://ci.de.dariah.eu/exist-repo/find.zip?abbrev=${code-viewer.abbrev}&processor=${exist.version}" + dest="${build.dir}/sade/autodeploy/codeview-latest.xar" /> </target> <target name="test.if.code-viewer.is.enabled"> -- GitLab From 2fa7d2667ad8292d07c7c64f2d0178268a7a259a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 12:30:27 +0100 Subject: [PATCH 28/32] test CI sensitivity for line breaks --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0eb2dd5..d435846 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,6 +29,7 @@ build: artifacts: paths: - build/sade/ + build: stage: build only: -- GitLab From c2dcec88676fb2fcbec7ff34cbebca047af7e360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 12:31:45 +0100 Subject: [PATCH 29/32] test CI for job name usage --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d435846..64c0b59 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ stages: variables: APTLY: 'https://ci.de.dariah.eu/aptlyAPI' -build: +build-develop: stage: build except: - master @@ -30,7 +30,7 @@ build: paths: - build/sade/ -build: +build-master: stage: build only: - master -- GitLab From 1b917070d10337e02aa38915eb442d7e23a45637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 12:41:01 +0100 Subject: [PATCH 30/32] chaining jobs --- .gitlab-ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 64c0b59..bf02b13 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ stages: variables: APTLY: 'https://ci.de.dariah.eu/aptlyAPI' -build-develop: +build:develop: stage: build except: - master @@ -30,7 +30,7 @@ build-develop: paths: - build/sade/ -build-master: +build:master: stage: build only: - master @@ -43,10 +43,8 @@ build-master: paths: - build/sade/ -test-basic: +test:basic: stage: test1 - dependencies: - - build script: - DIR="$(pwd)" # remove an old testlogfile @@ -63,7 +61,7 @@ test-basic: stage: test2 allow_failure: true dependencies: - - test-basic + - test:basic script: - mkdir --parents /var/lib/textgrid/ - touch /var/lib/textgrid/charmap.txt -- GitLab From 634064601f8f54a0d3bc741001ab9c51aa5e7435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 12:48:02 +0100 Subject: [PATCH 31/32] test for shutdown password --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bf02b13..afe4f11 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,7 +51,7 @@ test:basic: - mv build/sade /opt/ - bash '/opt/sade/bin/startup.sh' & - while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 2s; done - - cd /opt/sade/bin; ./shutdown.sh -u admin -p "$pw" + - bash '/opt/sade/bin/shutdown.sh -u admin -p ""' - cd $DIR artifacts: paths: -- GitLab From 0fe5cc4e6404218defbe64a29a380a7ef315240b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20G=C3=B6bel?= <goebel@sub.uni-goettingen.de> Date: Tue, 15 Jan 2019 12:53:12 +0100 Subject: [PATCH 32/32] test shutdown --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index afe4f11..71e7881 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,7 +51,7 @@ test:basic: - mv build/sade /opt/ - bash '/opt/sade/bin/startup.sh' & - while [ $(curl --head --silent http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 2s; done - - bash '/opt/sade/bin/shutdown.sh -u admin -p ""' + - bash '/opt/sade/bin/shutdown.sh' - cd $DIR artifacts: paths: -- GitLab