Marc Kupietz | 9238402 | 2023-02-11 14:06:40 +0100 | [diff] [blame] | 1 | # gitlab ci pipeline to build kalamar docker container |
| 2 | # automatically triggered on tag pushs or run manually |
| 3 | # |
Marc Kupietz | 3a84a80 | 2024-09-03 06:47:37 +0200 | [diff] [blame] | 4 | # Download latest container from artifacts and import it: |
Marc Kupietz | 9238402 | 2023-02-11 14:06:40 +0100 | [diff] [blame] | 5 | # |
Marc Kupietz | 3a84a80 | 2024-09-03 06:47:37 +0200 | [diff] [blame] | 6 | # curl -Ls 'https://gitlab.ids-mannheim.de/KorAP/Kalamar/-/jobs/artifacts/master/raw/kalamar.tar.xz?job=build-docker' | docker load |
| 7 | |
Marc Kupietz | 9238402 | 2023-02-11 14:06:40 +0100 | [diff] [blame] | 8 | image: docker:latest |
| 9 | |
| 10 | services: |
| 11 | - docker:dind |
| 12 | |
Marc Kupietz | 3a84a80 | 2024-09-03 06:47:37 +0200 | [diff] [blame] | 13 | build-docker: |
Marc Kupietz | 9238402 | 2023-02-11 14:06:40 +0100 | [diff] [blame] | 14 | 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 Kupietz | 3a84a80 | 2024-09-03 06:47:37 +0200 | [diff] [blame] | 26 | - 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 Kupietz | 9238402 | 2023-02-11 14:06:40 +0100 | [diff] [blame] | 32 | artifacts: |
| 33 | paths: |
Marc Kupietz | 3a84a80 | 2024-09-03 06:47:37 +0200 | [diff] [blame] | 34 | - kalamar.tar.xz |
Marc Kupietz | 9238402 | 2023-02-11 14:06:40 +0100 | [diff] [blame] | 35 | |