Skip to content

Commit 83dba0e

Browse files
Merge branch 'develop' into ftr-133-add-support-for-tei-rendition
2 parents 37078ab + f5a4538 commit 83dba0e

File tree

6 files changed

+136
-5
lines changed

6 files changed

+136
-5
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Docker Build and Push
2+
3+
on:
4+
release:
5+
types: [published] # Triggers only when a release is published (not created or edited)
6+
7+
jobs:
8+
build-and-push:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v6
13+
14+
- name: Login to Docker Hub
15+
uses: docker/login-action@v3
16+
with:
17+
username: vifebot
18+
password: ${{ secrets.VIFEBOT_DOCKERHUB_TOKEN }}
19+
20+
- name: Build and push Docker image
21+
run: |
22+
IMAGE_NAME="edirom/edirom-online-backend"
23+
TAG=${GITHUB_REF#refs/tags/}
24+
25+
docker build -t $IMAGE_NAME:$TAG .
26+
docker push $IMAGE_NAME:$TAG

.github/workflows/pre-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
- name: Upload Artifacts to action run
3737
if: github.repository == 'Edirom/Edirom-Online-Backend'
38-
uses: actions/upload-artifact@v6
38+
uses: actions/upload-artifact@v7
3939
with:
4040
# The name that the artifact will be made available under
4141
name: Edirom-Online-Backend-${{ steps.short-sha.outputs.sha }}.zip
@@ -76,7 +76,7 @@ jobs:
7676
sudo apt-get update
7777
sudo apt-get install libxml2-utils
7878
- name: Download artifact from previous job
79-
uses: actions/download-artifact@v7
79+
uses: actions/download-artifact@v8
8080
with:
8181
name: ${{ needs.build.outputs.artifact_name }}
8282
path: xars
@@ -113,7 +113,7 @@ jobs:
113113
REPO: ${{ github.event.repository.name }}
114114

115115
- name: Download artifact from previous job
116-
uses: actions/download-artifact@v7
116+
uses: actions/download-artifact@v8
117117
with:
118118
name: ${{ needs.build.outputs.artifact_name }}
119119
path: xars

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ identifiers:
4646
value: 10.5281/zenodo.17953690
4747
description: Edirom Online Backend
4848
repository-code: https://github.com/Edirom/Edirom-Online-Backend
49-
commit: 7a6af6843f3a67ad39e0bb54dbe256394f0e8be9
49+
commit: c4f17cff6cc53022b4e4d6fdabf106f7e8fa79a5
5050
abstract: >-
5151
Edirom-Online Backend is the backend for the Edirom
5252
Online which is used for the presentation and

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
######################################
2+
# Multi-stage Dockerfile
3+
# 1. Set up and build environment
4+
# 2. Run the eXist-db and deploy XARs
5+
######################################
6+
7+
8+
#########################
9+
# 1. Build Environment
10+
#########################
11+
12+
FROM eclipse-temurin:21 as builder
13+
14+
# installing Apache Ant
15+
RUN apt-get install -y --no-install-recommends apt-transport-https \
16+
&& apt-get update \
17+
&& apt-get install -y --no-install-recommends ant curl zip unzip patch git
18+
19+
WORKDIR /opt/eo-backend
20+
21+
COPY . .
22+
23+
RUN ant
24+
25+
26+
#########################
27+
# 2. Run/deploy eXist-db
28+
#########################
29+
30+
FROM stadlerpeter/existdb:6
31+
32+
# copy built XARs to autodeploy directory of exist
33+
COPY --from=builder /opt/eo-backend/build-xar/*.xar ${EXIST_HOME}/autodeploy/

data/xql/getAudio.xql

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
xquery version "3.1";
2+
(:
3+
: For LICENSE-Details please refer to the LICENSE file in the root directory of this repository.
4+
:)
5+
6+
(: IMPORTS ================================================================= :)
7+
8+
import module namespace eutil = "http://www.edirom.de/xquery/eutil" at "../xqm/eutil.xqm";
9+
10+
(: NAMESPACE DECLARATIONS ================================================== :)
11+
12+
declare namespace mei = "http://www.music-encoding.org/ns/mei";
13+
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
14+
declare namespace request = "http://exist-db.org/xquery/request";
15+
16+
17+
(: OPTION DECLARATIONS ===================================================== :)
18+
19+
declare option output:method "json";
20+
declare option output:media-type "application/json";
21+
22+
23+
(: QUERY BODY ============================================================== :)
24+
25+
(: Query parameter :)
26+
let $uri := request:get-parameter('uri', '')
27+
28+
(: Load MEI document :)
29+
let $docUri :=
30+
if (contains($uri, '#')) then
31+
(substring-before($uri, '#'))
32+
else
33+
($uri)
34+
let $doc := eutil:getDoc($docUri)
35+
36+
(: Extract relevant information :)
37+
let $artist := $doc//mei:titleStmt/mei:respStmt/mei:persName[@role = 'artist']
38+
let $album := $doc//mei:meiHead/mei:fileDesc/mei:sourceDesc/mei:source[1]/mei:titleStmt/mei:title[1]/text()
39+
let $albumCover := $doc//mei:graphic[@type = 'cover']/string(@target)
40+
41+
(: Build records objects :)
42+
let $records :=
43+
for $rec in $doc//mei:recording
44+
let $recSource := $doc//mei:source[@xml:id = substring-after($rec/@decls, '#')]
45+
let $recTitle := $recSource/mei:titleStmt/string-join(mei:title, '; ')
46+
let $avFile := $rec/mei:avFile[1]/string(@target)
47+
let $avType := $rec/mei:avFile[1]/string(@mimetype)
48+
return
49+
map {
50+
'title': replace($recTitle, '"', '\\"'),
51+
'composer': replace($artist, '"', '\\"'),
52+
"work": replace($album, '"', '\\"'),
53+
"src": $avFile,
54+
(: "cover": $albumCover, :)
55+
"type": $avType
56+
}
57+
58+
(: Build and return result object :)
59+
let $result :=
60+
map {
61+
'audios': array {$records},
62+
'success': true(),
63+
'total': count($records)
64+
}
65+
66+
return
67+
$result

data/xql/getAudioPlayer.xql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
xquery version "3.1";
2+
(:
3+
: NOTE: DEPREACTED - use getAudio.xql for edirom-audio-player web component instead
4+
:)
5+
6+
27
(:
38
: For LICENSE-Details please refer to the LICENSE file in the root directory of this repository.
49
:)
@@ -35,7 +40,7 @@ let $albumCover := $doc//mei:graphic[@type = 'cover']/string(@target)
3540
let $records :=
3641
for $rec in $doc//mei:recording
3742
let $recSource := $doc//mei:source[@xml:id = substring-after($rec/@decls, '#')]
38-
let $recTitle := $recSource/mei:titleStmt/mei:title
43+
let $recTitle := $recSource/mei:titleStmt/string-join(mei:title, ';')
3944
let $avFile := $rec/mei:avFile[1]/string(@target)
4045
return
4146
(:TODO map instead of concatenation :)

0 commit comments

Comments
 (0)