blob: db01f6a2203c89a6a0b6b3e14bae928b97cb3c45 [file] [log] [blame]
Marc Kupietz3d82f562024-03-16 10:19:03 +01001
2stages:
3 - test
4 - build
5 - deploy
6
7variables:
8 VID: $VID
9 DEBIAN_FRONTEND: noninteractive
10 APT_CACHE_DIR: apt-cache
Marc Kupietzd320f992024-04-19 12:30:04 +020011 SRC_DIR: test/resources/DNB
12 YEARS: 18
Marc Kupietz3d82f562024-03-16 10:19:03 +010013
14build-and-test-i5:
15 stage: test
16 image: rocker/verse
17 artifacts:
18 paths:
19 - "target/*.i5.xml"
20 - "target/*.zip"
21 cache:
22 - key: DNB4KorAP
23 paths:
24 - apt-cache/
25
26 before_script:
27 - source `find .. -name section_helper.sh`
28 - start_section install_linux_packages "Installing missing Linux packages"
29 - apt-get -o dir::cache::archives="$APT_CACHE_DIR" update
30 - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y libxml2-utils
31 - end_section install_linux_packages
32
33 script:
34 - start_section checking_i5 "Building and testing I5 files"
Marc Kupietz2fe36fa2024-04-15 21:02:36 +020035 - make -j $(nproc) test YEARS=18
Marc Kupietz3d82f562024-03-16 10:19:03 +010036 - end_section checking_i5
37
38
Marc Kupietz6d534882024-03-17 16:25:26 +010039build-index:
Marc Kupietz3d82f562024-03-16 10:19:03 +010040 image: perl:5.38
Marc Kupietzb169c272024-03-16 12:07:54 +010041 services:
42 - docker:dind
Marc Kupietz3d82f562024-03-16 10:19:03 +010043 stage: build
44 rules:
45 - if: $CI_COMMIT_TAG =~ /.+/
46 variables:
47 VID: $CI_COMMIT_TAG
48 - when: manual
49 variables:
50 VID: $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
51 PERL_LOCAL_LIB_ROOT: ./perl5
52 PERL5LIB: ./perl5/lib/perl5
53 cache:
54 - key: DNB4KorAP
55 paths:
56 - $PERL_LOCAL_LIB_ROOT
57 - perl5/
58 - apt-cache/
59 - key:
60 files:
Marc Kupietz94bbe6b2024-04-10 20:35:48 +020061 - target/dnb18.i5.xml
Marc Kupietz3d82f562024-03-16 10:19:03 +010062 paths:
Marc Kupietz94bbe6b2024-04-10 20:35:48 +020063 - target/dnb18.zip
64 - target/dnb18.tree_tagger.zip
65 - target/dnb18.marmot-malt.zip
66 - target/dnb18.spacy.zip
67 - target/dnb18.krill.tar
Marc Kupietz13e28582024-04-19 11:26:01 +020068
Marc Kupietz3d82f562024-03-16 10:19:03 +010069 before_script:
70 - source `find .. -name section_helper.sh`
71 - start_section install_linux_packages "Installing missing Linux packages"
72 - mkdir -pv $APT_CACHE_DIR
73 - apt-get -o dir::cache::archives="$APT_CACHE_DIR" update
Marc Kupietzb169c272024-03-16 12:07:54 +010074 - apt-get -o dir::cache::archives="$APT_CACHE_DIR" install -y rsync pv jq curl openjdk-17-jre-headless docker.io
Marc Kupietz3d82f562024-03-16 10:19:03 +010075 - end_section install_linux_packages
76
Marc Kupietzb169c272024-03-16 12:07:54 +010077 - start_section install_tree_tagger "Installing TreeTagger"
Marc Kupietz420260d2024-03-17 19:14:10 +010078 - docker image inspect korap/conllu2treetagger:latest >/dev/null 2>&1 || curl -Ls 'https://gitlab.ids-mannheim.de/KorAP/CoNLL-U-Treetagger/-/jobs/artifacts/master/raw/conllu2treetagger.xz?job=build-docker-image' | docker load
Marc Kupietzb169c272024-03-16 12:07:54 +010079 - end_section install_tree_tagger
80
Marc Kupietz6d534882024-03-17 16:25:26 +010081 - start_section install_spacy "Installing spaCy"
Marc Kupietz420260d2024-03-17 19:14:10 +010082 - docker image inspect korap/conllu2spacy:latest >/dev/null 2>&1 || curl -Ls https://corpora.ids-mannheim.de/tools/conllu2spacy.tar.xz | docker load
Marc Kupietz6d534882024-03-17 16:25:26 +010083 - end_section install_spacy
84
Marc Kupietz3d82f562024-03-16 10:19:03 +010085 - start_section install_perl_packages "Installing missing Perl packages"
86 - curl -L https://cpanmin.us | perl - App::cpanminus
87 - cpanm -n -l $PERL_LOCAL_LIB_ROOT File::ShareDir::Install https://github.com/KorAP/KorAP-XML-TEI.git
Marc Kupietzf73a91d2024-04-10 20:45:42 +020088 - cpanm -n -l $PERL_LOCAL_LIB_ROOT https://github.com/KorAP/KorAP-XML-Krill.git
89 - cpanm -n -l $PERL_LOCAL_LIB_ROOT https://github.com/KorAP/KorAP-XML-CoNLL-U.git
Marc Kupietz3d82f562024-03-16 10:19:03 +010090 - end_section install_perl_packages
91
92 script:
93 - export PATH=$PERL_LOCAL_LIB_ROOT/bin:$PATH
Marc Kupietz6d534882024-03-17 16:25:26 +010094 - start_section building_index "Building index"
Marc Kupietz420260d2024-03-17 19:14:10 +010095 - touch target/*.zip # ignore timestamps in make
96 - sleep 1
Marc Kupietz48c6a682024-03-24 15:27:08 +010097 - touch target/*.*.zip
Marc Kupietz13e28582024-04-19 11:26:01 +020098 - MAX_THREADS=2 make -j $(nproc) target/dnb.index.tar.xz
Marc Kupietz3d82f562024-03-16 10:19:03 +010099 - end_section building_krill
100 artifacts:
101 paths:
Marc Kupietzb169c272024-03-16 12:07:54 +0100102 - target/*.zip
Marc Kupietz94bbe6b2024-04-10 20:35:48 +0200103 - target/dnb18.index.tar.xz
Marc Kupietz3d82f562024-03-16 10:19:03 +0100104
105deploy:
106 stage: deploy
107 dependencies:
Marc Kupietz420260d2024-03-17 19:14:10 +0100108 - "build-index"
Marc Kupietz3d82f562024-03-16 10:19:03 +0100109 when: manual
110 image: rocker/verse
111 before_script:
112 - source `find .. -name section_helper.sh`
113 - start_section setup_ssh "Setting up SSH"
114 - apt-get update
115 - apt-get install -y rsync openssh-client
116 - mkdir -p ~/.ssh
117 - chmod 700 ~/.ssh
118 - eval $(ssh-agent -s)
119 - chmod 400 $SSH_PRIVATE_KEY
120 - ssh-add $SSH_PRIVATE_KEY
121 - end_section setup_ssh
122 script:
Marc Kupietzb7696992024-03-18 17:41:15 +0100123 - start_section korapxmlu "Uploading index to KorAP4DNB instance"
Marc Kupietz94bbe6b2024-04-10 20:35:48 +0200124 - touch target/dnb18.index.tar.xz
Marc Kupietzb7696992024-03-18 17:41:15 +0100125 - make deploy
Marc Kupietz3d82f562024-03-16 10:19:03 +0100126 - end_section deploy