blob: 23bd552f7b48bea69ad9ecbe3aad0df1539c75ba [file] [log] [blame]
Marc Kupietz5b6a51e2022-04-11 21:23:30 +02001image: metacpan/metacpan-api
2
3build-and-test:
4 stage: build
5 before_script:
6 - pwd
7 - source `find .. -name section_helper.sh`
8
9 - start_section install_linux_packages "Installing missing Linux packages"
10 - apt update && apt -y install cmake libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev libomp-dev
11 - end_section install_linux_packages
12
13 - start_section install_rocksdb_static "Building and installing rocksdb-static"
14 - curl -L https://github.com/facebook/rocksdb/archive/refs/tags/v5.11.3.tar.gz | tar zx
15 - cd rocksdb-5.11.3
Marc Kupietz3e3e3262022-04-12 23:11:45 +020016 - export PROCS=$(nproc)
Marc Kupietz5b6a51e2022-04-11 21:23:30 +020017 - make -j $PROCS static_lib DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w
18 - make install-static DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w
19 - end_section install_rocksdb_static
20
21 - start_section install_rocksdb_shared "Building and installing rocksdb-shared"
22 - make -j $PROCS shared_lib DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w
23 - make install-shared DISABLE_WARNING_AS_ERROR=1 WARNING_FLAGS=-w
24 - ldconfig
25 - cd ..
26 - end_section rocksdb_shared
27
28 - start_section install_collocatordb "Building and installing collocatordb"
Marc Kupietza7afe932022-05-19 09:21:03 +020029 - git clone "https://korap.ids-mannheim.de/gerrit/ids-kl/collocatordb"
Marc Kupietz5b6a51e2022-04-11 21:23:30 +020030 - cd collocatordb
31 - mkdir -p build
32 - cd build
33 - cmake ..
34 - make
35 - make install # && ctest --extra-verbose
36 - ldconfig
37 - end_section install_collocatordb
38 - cd ../..
39
40 script:
41 - start_section build_perl_dependencies "Installing Perl dependencies"
42 - cpanm https://github.com/Akron/Mojolicious-Plugin-Localize.git
43 - cpanm --installdeps .
44 - end_section build_perl_dependencies
45
46 - start_section build_derekovecs-server "Building DeReKoVecs server"
47 - perl Makefile.PL
48 - make
49 - make install
50 - end_section build_derekovecs-server
51
Marc Kupietz3e3e3262022-04-12 23:11:45 +020052 - start_section run_derekovecs-server "Testing DeReKoVecs server"
53 - prove --verbose t
Marc Kupietz5b6a51e2022-04-11 21:23:30 +020054 - end_section run_derekovecs-server
55
Marc Kupietzddba9082023-11-06 06:59:14 +010056deploy:
57 rules:
58 - if: $CI_COMMIT_TAG =~ /.+/
59 variables:
60 VID: $CI_COMMIT_TAG
61 - when: manual
62 variables:
63 VID: $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
64 stage: deploy
65 before_script:
66 - source `find .. -name section_helper.sh`
67 - start_section install_linux_packages "Installing missing Linux packages"
68 - 'command -v ssh-agent >/dev/null || apt-get install openssh-client -y'
69 - mkdir -p ~/.ssh
70 - chmod 700 ~/.ssh
71 - eval $(ssh-agent -s)
72 - chmod 400 "$SSH_PRIVATE_KEY"
73 - ssh-add "$SSH_PRIVATE_KEY"
74 - end_section install_linux_packages
75 script:
76 - echo "This is a manual job which doesn't start automatically, and the pipeline can complete without it starting."
77 - ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $DEPLOY_HOST "cd /opt/korap/derekovecs && git stash && git pull && cpanm --installdeps . && cpanm . && rm -rf _Inline && sudo systemctl restart derekovecs"