Commit da4b3729 authored by MRodz's avatar MRodz
Browse files

Comment everything

parent 5e16fd02
Pipeline #77078 failed with stage
......@@ -13,7 +13,7 @@ import module namespace tgclient="http://textgrid.info/namespaces/xquery/tgclien
: @result A string that complies to RGB terminal color code
: @see https://en.wikipedia.org/wiki/ANSI_escape_code#24-bit
: :)
declare function local:getColor($pos as xs:int, $count as xs:int)
(:declare function local:getColor($pos as xs:int, $count as xs:int)
as xs:string {
let $steps := (510 div $count) => floor()
let $this := $pos * $steps
......@@ -62,15 +62,15 @@ declare variable $sid :=
$config("textgrid.password")
);
let $log := util:log-system-out( "[30;43m initiating post-install.xql [0m" )
let $log := util:log-system-out( "[30;43m initiating post-install.xql [0m" ):)
(: the uris we need to publish in an intended order! :)
let $filters := <filters>
(:let $filters := <filters>
<filter key="format" value="text/xml"/>
<filter key="project.id" value="TGPR-9b18459d-3a6b-004f-b6aa-4fba2b9e1d3e"/>
</filters>
</filters>:)
(: im Titel nicht "Notizbuch" :)
let $log := util:log-system-out( "&#27;[30;43m getting non-notebook XML URIs &#27;[0m" )
(:let $log := util:log-system-out( "&#27;[30;43m getting non-notebook XML URIs &#27;[0m" )
let $query := "%21%28title%3A%22Notizbuch%22%29"
let $non-notebook-xmls := tgclient:tgsearch-query-filter($filters, $query, $sid, 2000, 0)
//tgmd:textgridUri/substring-before(., ".")
......@@ -89,9 +89,9 @@ let $tble-objects := tgclient:tgsearch-query-filter($filters, $query, $sid, 2000
let $filters := <filters>
<filter key="format" value="text/xml"/>
<filter key="project.id" value="TGPR-9b18459d-3a6b-004f-b6aa-4fba2b9e1d3e"/>
</filters>
</filters>:)
(: im Titel "Notizbuch" :)
let $query := "%28title%3A%22Notizbuch%22%29"
(:let $query := "%28title%3A%22Notizbuch%22%29"
let $log := util:log-system-out( "&#27;[30;43m getting notebook XML URIs &#27;[0m" )
let $notebooks := tgclient:tgsearch-query-filter($filters, $query, $sid, 2000, 0)
//tgmd:textgridUri/substring-before(., ".")
......@@ -100,8 +100,8 @@ let $notebooks := ()
let $countNotebooks := count($notebooks)
let $special-files := ("textgrid:342bm", (: synonyms.txt :)
"textgrid:34rhf") (: charmap.txt :)
let $special-files := ("textgrid:342bm",
"textgrid:34rhf")
let $installSequence := ( $special-files, $tble-objects, $non-notebook-xmls, $notebooks )
let $report := for $uri at $pos in $installSequence
......@@ -111,18 +111,18 @@ let $report := for $uri at $pos in $installSequence
let $log := if(count($notebooks) lt 10)
then util:log-system-out( "&#27;[38;5;210m&#27;[48;5;33m we are on fastdeploy! &#27;[0m" )
else util:log-system-out( "&#27;[38;5;231m&#27;[48;5;52m complete import… got coffee? &#27;[0m" )
let $count := count( $installSequence )
let $count := count( $installSequence ):)
(: there are some documents with an unknown status in the pipeline: :)
let $removeSomeObjects := if( $config("sade.develop") = "true" )
(: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"):)
"textgrid:253sx", "textgrid:253t0", "textgrid:253t1", "textgrid:253t2", "textgrid:253t3")
return
(
( :)
(: PUBLISH :)
util:log-system-out( "getting DATA from TextGrid…" ),
(:util:log-system-out( "getting DATA from TextGrid…" ),
for $uri at $pos in $installSequence[. != $removeSomeObjects]
where starts-with($uri, "textgrid:")
let $color := local:getColor($pos, $count)
......@@ -145,9 +145,9 @@ util:log-system-out( "getting DATA from TextGrid…" ),
} catch * { <error code="{$err:code}" timestamp="{current-dateTime()}">{$err:description}</error> }
return
update insert ( <report uri="{$uri}" started="{$startTime}" finished="{util:system-time()}">{$response}</report>) into //initlog/install/done,
:)
(: INDEX :)
util:log-system-out( "reindexing…" ),
(:util:log-system-out( "reindexing…" ),
let $doc := doc( "/db/system/config/db/sade-projects/textgrid/data/xml/data/collection.xconf" )/*
let $tmp := xmldb:store( "/db", "tmp-collection.xconf", $doc )
let $log := util:log-system-out( "storing temp:" || $tmp )
......@@ -164,15 +164,15 @@ util:log-system-out( "reindexing…" ),
xmldb:reindex("/db/sade-projects/textgrid/data/xml/data"),
xmldb:reindex("/db/sade-projects/textgrid/data/xml/meta"),
xmldb:reindex("/db/sade-projects/textgrid/cache"),:)
xmldb:reindex("/db/sade-projects/textgrid/cache"),
util:log-system-out( "almost done" )
util:log-system-out( "almost done" ):)
(: beacon to end on running gitlab CI :)
util:eval("file:serialize(<done/>, '/tmp/sade.beacon', ())"),
(:util:eval("file:serialize(<done/>, '/tmp/sade.beacon', ())"),:)
(: set correct mode for autostart trigger :)
sm:chmod(xs:anyURI("/db/system/autostart"), "rwxrwx---"),
(: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--"):)
)
sm:chmod(xs:anyURI("/db/sade-projects/textgrid/data/xml/xq/get.xq"), "rwxr-xr--")
):)
Markdown is supported
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