-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
91 lines (91 loc) · 2.8 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
image: docker:latest
services:
- docker:dind
- name: "docker.elastic.co/elasticsearch/elasticsearch:7.10.0"
alias: "elasticsearch"
command: [ "bin/elasticsearch", "-Expack.security.enabled=false", "-Ediscovery.type=single-node" ]
cache:
paths:
- .m2/repository
variables:
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
ELASTICSEARCH_URL: "http://elasticsearch:9200"
stages:
- build
- test
- use
- deploy
include:
- template: Code-Quality.gitlab-ci.yml
- template: Dependency-Scanning.gitlab-ci.yml
noark5tester-runtest:
stage: test
variables:
baseurl: http://localhost:8092/noark5v5/
image: debian:buster
allow_failure: false
before_script:
- apt update
- apt install -y git maven curl python3 unoconv python3-tz
- apt install -y tesseract-ocr-nor
- git clone https://github.com/petterreinholdtsen/noark5-tester
- curl "http://elasticsearch:9200/_cat/health?v"
script:
- scripts/run-runtest
artifacts:
paths:
- nikita-run.log
noark5tester-inoutin:
stage: use
variables:
baseurl: http://localhost:8092/noark5v5/
image: debian:buster
allow_failure: false
before_script:
- apt update
- apt install -y git maven curl python3 python3-tz python3-lxml jq python3-dateutil
python3-stdnum
- apt install -y tesseract-ocr-nor
- apt install -y libxml2-utils
- git clone https://github.com/petterreinholdtsen/noark5-tester
- curl "http://elasticsearch:9200/_cat/health?v"
script:
- scripts/run-inoutin-test
artifacts:
paths:
- nikita-run.log
- noark5-tester/json-dump-*/*
- noark5-tester/uttrekk-*/*
- noark5-tester/nikita-xml-validation-report.txt
maven-build:
before_script:
- apt update
- apt install -y unoconv
- apt install -y tesseract-ocr-nor
image: maven:3.6.1-jdk-11
stage: build
script:
- mvn package -B
- mvn test
artifacts:
paths:
- target/*.jar
- target/generate*/**
code_quality:
stage: test
artifacts:
expose_as: Code Quality Report
paths:
- gl-code-quality-report.json
docker-build-master:
before_script:
- apt update
image: maven:3.6.1-jdk-11
stage: deploy
script:
- mvn compile jib:build -Djib.to.image=registry.hub.docker.com/oslometabi/nikita-noark5-core:latest
-Djib.to.auth.username=$DOCKER_HUB_USER -Djib.to.auth.password=$DOCKER_HUB_PASSWORD
only:
- master