Commit 231de174 authored by Jonas Waeber's avatar Jonas Waeber

Fix institution-type-labels.csv

Update gitlab-ci with templates
parent 52c28661
Pipeline #17384 passed with stages
in 4 minutes and 35 seconds
......@@ -5,47 +5,10 @@ stages:
- test
- publish
test:
stage: test
image: gradle:6.3-jdk8
tags:
- mbr
script:
- gradle --no-daemon --no-scan --no-build-cache test --fail-fast
build:
stage: publish
tags:
- mbr
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
only:
- tags
test-chart:
stage: test
image: dtzar/helm-kubectl:3.2.0
tags:
- mbr
script:
- helm lint helm-charts/
publish-chart:
stage: publish
image: dtzar/helm-kubectl:3.2.0
tags:
- mbr
script:
- export HELM_EXPERIMENTAL_OCI=1
- helm registry login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
- ./insert_chart_versions.sh
- helm chart save helm-charts/ "$CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_TAG-chart"
- helm chart push "$CI_REGISTRY/$CI_PROJECT_PATH:$CI_COMMIT_TAG-chart"
- helm registry logout "$CI_REGISTRY"
only:
- tags
\ No newline at end of file
include:
- project: 'memoriav/memobase-2020/utilities/ci-templates'
file: 'gradle-test/gradle-test.yml'
- project: 'memoriav/memobase-2020/utilities/ci-templates'
file: 'docker-image/docker-image.yml'
- project: 'memoriav/memobase-2020/utilities/ci-templates'
file: 'helm-chart/helm-chart.yml'
......@@ -13,7 +13,7 @@ object LoadFile {
val labelsMap = mutableMapOf<String, FacetContainer>()
for (row in labelList.listIterator(1)) {
labelsMap[row[0]] = FacetContainer(LanguageContainer(listOf(row[1]), listOf(row[2]), listOf(row[3]), emptyList()), null, emptyList())
labelsMap[row[0]] = FacetContainer(LanguageContainer(listOf(row[1].trim()), listOf(row[2].trim()), listOf(row[3].trim()), emptyList()), null, emptyList())
}
return labelsMap
}
......
package org.memobase
import com.beust.klaxon.Klaxon
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import org.memobase.helpers.AspectRatio
import org.memobase.helpers.LoadFile
import java.io.File
import java.nio.charset.Charset
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class TestLoadFile {
private val klaxon = Klaxon()
private val dataPath = "src/test/resources/data/loadFile"
private fun readFile(fileName: String): String {
return File("$dataPath/$fileName").readText(Charset.defaultCharset())
}
@Test
fun `test load file institution type labels`() {
val result = LoadFile.readLabelFile("src/test/resources/configs/institution-type-labels.csv")
assertThat(klaxon.toJsonString(result))
.isEqualTo(readFile("output.json"))
}
}
\ No newline at end of file
id,de,fr,it
Q166118,Archiv,Archives,Archivio
Q327333,Behörde,autorité,autorità
Q7075,Bibliothek,Bibliothèque,Biblioteca
Q2385804,Bildungseinrichtung,Institution d'enseignement,Istituzione d'istruzione
Q31855,Forschungseinrichtung,Institution de recherche,Istituzione di ricerca
Q38723,Hochschule,Université,Università
Q33506,Museum,Musée,Museo
Q163740,Non-Profit-Organisation,Organisme sans but lucratif,Organizzazione non a scopo di lucro
Q591763,Privatwirtschaft,Secteur privé,Settore privato
Q15265344,Rundfunkveranstalter,Radio- et télédiffuseur,Emittente
Q15911314,Verband,Association,Associazione
id,de,fr,it
Q166118,Archiv,Archives,Archivio
Q327333,Behörde,autorité,autorità
Q7075,Bibliothek,Bibliothèque,Biblioteca
Q2385804,Bildungseinrichtung,Institution d'enseignement,Istituzione d'istruzione
Q31855,Forschungseinrichtung,Institution de recherche,Istituzione di ricerca
Q38723,Hochschule,Université,Università
Q33506,Museum,Musée,Museo
Q163740,Non-Profit-Organisation,Organisme sans but lucratif,Organizzazione non a scopo di lucro
Q591763,Privatwirtschaft,Secteur privé,Settore privato
Q15265344,Rundfunkveranstalter,Radio- et télédiffuseur,Emittente
Q15911314,Verband,Association,Associazione
Q2029941,Veranstalter,Organisateur,Organizzatore
\ No newline at end of file
{"published":false,"name":{"de":["RadioX"],"fr":["Test institution Oana (FR)"],"it":["Test institution Oana (IT)"],"un":[]},"description":{"de":["<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</p>"],"fr":["<p>test_description&nbsp;(FR)</p>"],"it":["<p>test_description&nbsp;&nbsp;(IT)</p>"],"un":[]},"city":[{"de":["Münchenstein"],"fr":["Münchenstein"],"it":["Münchenstein"],"un":[]},{"de":[],"fr":[],"it":[],"un":["Bern"]}],"address":["Helvetiapl. 5","Oslo-Strasse 8"],"postalCodes":["3005","4142"],"canton":[{"name":{"de":["Bern"],"fr":["Berne"],"it":["Berne"],"un":[]}},{"name":{"de":["Basel-Stadt"],"fr":["Bâle-Ville"],"it":["Bâle-Ville"],"un":[]}}],"type":[{"name":{"de":["Behörde"],"fr":["autorité"],"it":["autorità │"],"un":[]}},{"name":{"de":["Archiv"],"fr":["Archives"],"it":["Archivio │"],"un":[]}}],"documentType":[{"name":{"de":["PLACEHOLDER"],"fr":["PLACEHOLDER"],"it":["PLACEHOLDER"],"un":["PLACEHOLDER"]},"filter":"PLACEHOLDER","facet":["PLACEHOLDER"]}],"keyVisualLink":"https://mb-wf1.memobase.unibas.ch/sites/default/files/styles/teaser/public/2020-10/1.jpg?itok=5ncVBnVQ","numberOfRecordSets":1,"numberOfDocuments":0,"id":"RadioX"}
\ No newline at end of file
{"published":false,"name":{"de":["RadioX"],"fr":["Test institution Oana (FR)"],"it":["Test institution Oana (IT)"],"un":[]},"description":{"de":["<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</p>"],"fr":["<p>test_description&nbsp;(FR)</p>"],"it":["<p>test_description&nbsp;&nbsp;(IT)</p>"],"un":[]},"city":[{"de":["Münchenstein"],"fr":["Münchenstein"],"it":["Münchenstein"],"un":[]},{"de":[],"fr":[],"it":[],"un":["Bern"]}],"address":["Helvetiapl. 5","Oslo-Strasse 8"],"postalCodes":["3005","4142"],"canton":[{"name":{"de":["Bern"],"fr":["Berne"],"it":["Berne"],"un":[]}},{"name":{"de":["Basel-Stadt"],"fr":["Bâle-Ville"],"it":["Bâle-Ville"],"un":[]}}],"type":[{"name":{"de":["Behörde"],"fr":["autorité"],"it":["autorità"],"un":[]}},{"name":{"de":["Archiv"],"fr":["Archives"],"it":["Archivio"],"un":[]}}],"documentType":[{"name":{"de":["PLACEHOLDER"],"fr":["PLACEHOLDER"],"it":["PLACEHOLDER"],"un":["PLACEHOLDER"]},"filter":"PLACEHOLDER","facet":["PLACEHOLDER"]}],"keyVisualLink":"https://mb-wf1.memobase.unibas.ch/sites/default/files/styles/teaser/public/2020-10/1.jpg?itok=5ncVBnVQ","numberOfRecordSets":1,"numberOfDocuments":0,"id":"RadioX"}
\ No newline at end of file
{"Q166118": {"facet" : [], "filter" : null, "name" : {"de" : ["Archiv"], "fr" : ["Archives"], "it" : ["Archivio"], "un" : []}}, "Q327333": {"facet" : [], "filter" : null, "name" : {"de" : ["Behörde"], "fr" : ["autorité"], "it" : ["autorità"], "un" : []}}, "Q7075": {"facet" : [], "filter" : null, "name" : {"de" : ["Bibliothek"], "fr" : ["Bibliothèque"], "it" : ["Biblioteca"], "un" : []}}, "Q2385804": {"facet" : [], "filter" : null, "name" : {"de" : ["Bildungseinrichtung"], "fr" : ["Institution d'enseignement"], "it" : ["Istituzione d'istruzione"], "un" : []}}, "Q31855": {"facet" : [], "filter" : null, "name" : {"de" : ["Forschungseinrichtung"], "fr" : ["Institution de recherche"], "it" : ["Istituzione di ricerca"], "un" : []}}, "Q38723": {"facet" : [], "filter" : null, "name" : {"de" : ["Hochschule"], "fr" : ["Université"], "it" : ["Università"], "un" : []}}, "Q33506": {"facet" : [], "filter" : null, "name" : {"de" : ["Museum"], "fr" : ["Musée"], "it" : ["Museo"], "un" : []}}, "Q163740": {"facet" : [], "filter" : null, "name" : {"de" : ["Non-Profit-Organisation"], "fr" : ["Organisme sans but lucratif"], "it" : ["Organizzazione non a scopo di lucro"], "un" : []}}, "Q591763": {"facet" : [], "filter" : null, "name" : {"de" : ["Privatwirtschaft"], "fr" : ["Secteur privé"], "it" : ["Settore privato"], "un" : []}}, "Q15265344": {"facet" : [], "filter" : null, "name" : {"de" : ["Rundfunkveranstalter"], "fr" : ["Radio- et télédiffuseur"], "it" : ["Emittente"], "un" : []}}, "Q15911314": {"facet" : [], "filter" : null, "name" : {"de" : ["Verband"], "fr" : ["Association"], "it" : ["Associazione"], "un" : []}}, "Q2029941": {"facet" : [], "filter" : null, "name" : {"de" : ["Veranstalter"], "fr" : ["Organisateur"], "it" : ["Organizzatore"], "un" : []}}}
\ No newline at end of file
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