| # gitlab ci pipeline to build kalamar docker container |
| # automatically triggered on tag pushs or run manually |
| # |
| # Download latest container from artifacts and import it: |
| # |
| # curl -Ls 'https://gitlab.ids-mannheim.de/KorAP/Kalamar/-/jobs/artifacts/master/raw/kalamar.tar.xz?job=build-docker' | docker load |
| |
| image: docker:latest |
| |
| services: |
| - docker:dind |
| |
| build-docker: |
| rules: |
| - if: $CI_COMMIT_TAG =~ /.+/ |
| variables: |
| VID: $CI_COMMIT_TAG |
| - when: manual |
| variables: |
| VID: $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA |
| stage: build |
| before_script: |
| - apk update |
| - apk add --no-cache git |
| script: |
| - docker build -f Dockerfile -t korap/kalamar:$VID-large --target kalamar . |
| # - wget https://github.com/slimtoolkit/slim/releases/latest/download/dist_linux.tar.gz |
| # - tar zxf dist_linux.tar.gz |
| # - export PATH=$(pwd)/dist_linux:$PATH |
| - 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 |
| - docker save korap/kalamar:$VID | xz -T0 -M16G -9 > kalamar.tar.xz |
| artifacts: |
| paths: |
| - kalamar.tar.xz |
| |