blob: 7442d13b8e9a9c14e7b6cd90af15a040ae59a4e1 [file] [log] [blame]
Marc Kupietz92384022023-02-11 14:06:40 +01001# gitlab ci pipeline to build kalamar docker container
2# automatically triggered on tag pushs or run manually
3#
Marc Kupietz3a84a802024-09-03 06:47:37 +02004# Download latest container from artifacts and import it:
Marc Kupietz92384022023-02-11 14:06:40 +01005#
Marc Kupietz3a84a802024-09-03 06:47:37 +02006# curl -Ls 'https://gitlab.ids-mannheim.de/KorAP/Kalamar/-/jobs/artifacts/master/raw/kalamar.tar.xz?job=build-docker' | docker load
7
Marc Kupietz92384022023-02-11 14:06:40 +01008image: docker:latest
9
10services:
11 - docker:dind
12
Marc Kupietz3a84a802024-09-03 06:47:37 +020013build-docker:
Marc Kupietz92384022023-02-11 14:06:40 +010014 rules:
15 - if: $CI_COMMIT_TAG =~ /.+/
16 variables:
17 VID: $CI_COMMIT_TAG
18 - when: manual
19 variables:
20 VID: $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
21 stage: build
22 before_script:
23 - apk update
24 - apk add --no-cache git
25 script:
Marc Kupietz3a84a802024-09-03 06:47:37 +020026 - docker build -f Dockerfile -t korap/kalamar:$VID-large --target kalamar .
27# - wget https://github.com/slimtoolkit/slim/releases/latest/download/dist_linux.tar.gz
28# - tar zxf dist_linux.tar.gz
29# - export PATH=$(pwd)/dist_linux:$PATH
30 - docker run --rm -v /var/run/docker.sock:/var/run/docker.sock dslim/slim build --http-probe=true --exec="perl Makefile.PL && make test && unzip -v" --include-workdir=true --include-path=/usr/local/share/perl5/site_perl/KorAP/ --tag korap/kalamar:$VID --tag korap/kalamar:latest korap/kalamar:$VID-large
31 - docker save korap/kalamar:$VID | xz -T0 -M16G -9 > kalamar.tar.xz
Marc Kupietz92384022023-02-11 14:06:40 +010032 artifacts:
33 paths:
Marc Kupietz3a84a802024-09-03 06:47:37 +020034 - kalamar.tar.xz
Marc Kupietz92384022023-02-11 14:06:40 +010035