Skip to content
Snippets Groups Projects
Commit d4c634ec authored by Mathias Goebel's avatar Mathias Goebel :reminder_ribbon:
Browse files

Merge branch 'develop' into 'master'

Release 5.6.3

See merge request !19
parents 57e36009 1e8c8906
No related branches found
No related tags found
1 merge request!19Release 5.6.3
Pipeline #357357 passed
project.name=http://textgrid.de/exist/fontane-develop
project.version=5.5.0
project.version=5.6.3
project.abbrev=fontane
project.title=[Fontane] SADE-Project
project.processorversion=5.2.0
......
......@@ -101,6 +101,13 @@ declare variable $sid :=
$config("textgrid.password")
);
declare variable $isBackupAvailable :=
let $path := '/exist/data/export'
return
if(file:exists($path)) then
exists(file:list($path)//file:directory[starts-with(@name, 'full')])
else
false();
let $log := util:log-system-out( "[30;43m initiating post-install.xql [0m" )
let $fileSeparator := util:system-property("file.separator")
let $system-path := system:get-exist-home() || $fileSeparator
......@@ -160,13 +167,31 @@ let $log := if(count($notebooks) lt 10)
let $count := count( $installSequence )
(: there are some documents with an unknown status in the pipeline: :)
let $removeSomeObjects := if( $config("sade.develop") = "true" )
then ("textgrid:27656", "textgrid:27657", "textgrid:27658", "textgrid:2765b", "textgrid:2765c")
else ("textgrid:27656", "textgrid:27657", "textgrid:27658", "textgrid:2765b", "textgrid:2765c",
"textgrid:253sx", "textgrid:253t0", "textgrid:253t1", "textgrid:253t2", "textgrid:253t3")
let $removeSomeObjects :=
(
if( $config("sade.develop") = "true" )
then ("textgrid:27656", "textgrid:27657", "textgrid:27658", "textgrid:2765b", "textgrid:2765c")
else ("textgrid:27656", "textgrid:27657", "textgrid:27658", "textgrid:2765b", "textgrid:2765c",
"textgrid:253sx", "textgrid:253t0", "textgrid:253t1", "textgrid:253t2", "textgrid:253t3")
)
return
(
(: RESTORE PROVIDED DATA :)
(: kubernetes deployment :)
(: we want to skip the long-lasting publish porcess if we can restore existing data :)
(: in kubernetes we mount /exist/data/export from a persistent volume :)
(: if exported data is in there, we restore, else we create a backup after init. :)
(: for a complete recreation of the data, we have to remove the volume manually :)
(
if ($isBackupAvailable) then
let $log := util:log-system-out( "[48;2;"|| local:getColor(10, 500) ||"m[38;2;0;0;0m " || 'starting restore process' || " [0m" )
let $dirName := file:list("/exist/data/export")//file:directory[starts-with(@name, 'full')][last()]/string(@name)
return (
system:restore('/exist/data/export/' || $dirName || '/db/sade-projects/__contents__.xml', (), (), true()),
util:log-system-out( "[48;2;"|| local:getColor(499, 500) ||"m[38;2;0;0;0m " || 'restore process done. ready for take-off. \o/' || " [0m" ))
else (
(: PUBLISH :)
util:log-system-out( "getting DATA from TextGrid…" ),
for $uri at $pos in $installSequence[. != $removeSomeObjects]
......@@ -178,7 +203,7 @@ util:log-system-out( "getting DATA from TextGrid…" ),
|| " [0m" )
let $startTime := util:system-time()
let $response :=
try {
try { if(environment-variable('CI') eq 'true') then true() else
tgconnect:publish(
$uri,
$sid,
......@@ -192,8 +217,8 @@ util:log-system-out( "getting DATA from TextGrid…" ),
let $report := <report uri="{$uri}" started="{$startTime}" finished="{util:system-time()}">{$response}</report>
return (
update insert $report into //initlog/install/done,
if($response/local-name() = "error") then util:log-system-out( "[Fatal Error] " || serialize($report) ) else () ),
if($response/local-name() = "error") then util:log-system-out( "[Fatal Error] " || serialize($report) ) else () )
),
(: INDEX :)
util:log-system-out( "reindexing…" ),
let $doc := doc( "/db/system/config/db/sade-projects/textgrid/data/xml/data/collection.xconf" )/*
......@@ -227,3 +252,4 @@ for $uri at $pos in (collection("/db/apps/SADE")/base-uri())[ends-with(., ".xqm"
sm:chmod(xs:anyURI("/db/system/autostart"), "rwxrwx---"),
sm:chmod(xs:anyURI("/db/system/autostart/reindex.xq"), "rwxrwx---"),
sm:chmod(xs:anyURI("/db/sade-projects/textgrid/data/xml/xq/get.xq"), "rwxr-xr--")
)
\ No newline at end of file
......@@ -44,8 +44,7 @@ declare function local:cache($type as xs:string, $id as xs:string) {
let $item :=
switch ($type)
case "GND" return
let $requestEl := <hc:request method="get" href="{'https://d-nb.info/gnd/' || $id || '/about/rdf'}"/>
let $requestEl := <hc:request method="get" href="{ ('https://d-nb.info/gnd/' || $id || '/about/rdf' )}"></hc:request>
let $request := hc:send-request($requestEl)[2]
let $location-node := $request//geo:asWKT
return
......@@ -55,13 +54,13 @@ declare function local:cache($type as xs:string, $id as xs:string) {
else $location-node
case "OpenStreetMap:way" return
let $first-node-of-the-way :=
let $request3 := <hc:request method="get" href="{ "http://www.openstreetmap.org/api/0.6/way/"||$id }"/>
let $request3 := <hc:request method="get" href="{("http://www.openstreetmap.org/api/0.6/way/"||$id)}"/>
return
hc:send-request($request3)[2]//nd[1]/@ref)
hc:send-request($request3)[2]//nd[1]/@ref
return
local:cache("OpenStreetMap:node", $first-node-of-the-way)
case "OpenStreetMap:node" return
let $request4 := <hc:request method="get" href="{ "http://www.openstreetmap.org/api/0.6/node/"||$id }"/>
let $request4 := <hc:request method="get" href="{("http://www.openstreetmap.org/api/0.6/node/"||$id)}"/>
return
hc:send-request($request4)[2]//*:node
default return <item timestamp="{current-dateTime()}" type="{$type}" id="{$id}"/>
......
......@@ -52,7 +52,7 @@ as xs:string {
let $functionNames := ( tests:get-function-names($target)) => distinct-values() => count()
let $testedFunctionNames := ($tests//testcase/string(@class)) => distinct-values() => count()
let $coverage :=
if($testedFunctionNames = 0) then 0 else $testedFunctionNames div $functionNames
if($functionNames = 0) then 0 else $testedFunctionNames div $functionNames
return
tests:format-test-rate-output($coverage)
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment