Commit 7b71fc46 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

file ingest via pre install script

parent e424895d
Pipeline #131101 passed with stages
in 3 minutes and 43 seconds
......@@ -55,13 +55,14 @@ return
(: error(QName("FONTANE", "INSTALLATION"), "response from tgsearch is not satisfying.") :)
};
(: while working perfectly in eXist 4.7.x, xmldb:move failed silently in eXist 5.2.0
declare variable $moveProject1 := xmldb:copy-collection("/db/apps/fontane/sade-projects", "/db", true());
declare variable $log1 := util:log-system-out("moved 1");
declare variable $removeProject1 := xmldb:remove("/db/apps/fontane/sade-projects");
declare variable $moveProject2 := xmldb:copy-collection("/db/apps/fontane/system/config/db/sade-projects", "/db/system/config/db", true());
declare variable $log2 := util:log-system-out("moved 2");
declare variable $removeProject2 := xmldb:remove("/db/apps/fontane/system/config/db/sade-projects";
declare variable $moveProject3 := xmldb:move("/db/apps/fontane/system/autostart", "/db/system");
declare variable $log3 := util:log-system-out("moved 3");
declare variable $removeProject3 := xmldb:remove("/db/apps/fontane/system/autostart");
:)
declare variable $preconfigdoc := doc( "/db/sade-projects/textgrid/config.xml" );
declare variable $credentials := file:read("/var/lib/textgrid/fontane/credentials.txt")
=> tokenize("\n");
......
xquery version "3.1";
(: The following external variables are set by the repo:deploy function :)
(: file path pointing to the exist installation directory :)
declare variable $home external;
(: path to the directory containing the unpacked .xar package :)
declare variable $dir external;
(: the target collection into which the app is deployed :)
declare variable $target external;
let $fileSeparator := util:system-property("file.separator")
return (
xmldb:create-collection("/db", "sade-projects"),
xmldb:store-files-from-pattern(
(: target collection :) "/db/sade-projects",
(: source directory :) $dir || $fileSeparator || "sade-projects",
(: What to ingest :) "**/*",
(: MIME type :) (),
(: preserve structure :) true()
),
file:delete($dir || $fileSeparator || "sade-projects"),
xmldb:store-files-from-pattern(
(: target collection :) "/db/system",
(: source directory :) $dir || $fileSeparator || "system",
(: What to ingest :) "**/*",
(: MIME type :) (),
(: preserve structure :) true()
),
file:delete($dir || $fileSeparator || "system"),
util:log-system-out("fontane: pre-install finished")
)
\ No newline at end of file
......@@ -10,7 +10,7 @@
<copyright>true</copyright>
<type>application</type>
<target>fontane</target>
<prepare/>
<prepare>pre-insall.xq</prepare>
<finish>post-install.xq</finish>
<deployed>@timestamp@</deployed>
</meta>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment