Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SADE-Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fontane-notizbuecher
SADE-Project
Commits
d4c634ec
Commit
d4c634ec
authored
1 year ago
by
Mathias Goebel
Browse files
Options
Downloads
Plain Diff
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
!19
Release 5.6.3
Pipeline
#357357
passed
1 year ago
Stage: build
Stage: test
Stage: deploy
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
build.properties
+1
-1
1 addition, 1 deletion
build.properties
post-install.xq
+33
-7
33 additions, 7 deletions
post-install.xq
sade-projects/textgrid/data/xml/xq/kml.xq
+4
-5
4 additions, 5 deletions
sade-projects/textgrid/data/xml/xq/kml.xq
tests.xqm
+1
-1
1 addition, 1 deletion
tests.xqm
with
39 additions
and
14 deletions
build.properties
+
1
−
1
View file @
d4c634ec
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
...
...
This diff is collapsed.
Click to expand it.
post-install.xq
+
33
−
7
View file @
d4c634ec
...
...
@@ -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
This diff is collapsed.
Click to expand it.
sade-projects/textgrid/data/xml/xq/kml.xq
+
4
−
5
View file @
d4c634ec
...
...
@@ -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
}
"
/>
...
...
This diff is collapsed.
Click to expand it.
tests.xqm
+
1
−
1
View file @
d4c634ec
...
...
@@ -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
(
$
testedF
unctionNames
=
0
)
then
0
else
$testedFunctionNames
div
$functionNames
if
(
$
f
unctionNames
=
0
)
then
0
else
$testedFunctionNames
div
$functionNames
return
tests:format-test-rate-output
(
$coverage
)
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment