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 | # |
| 4 | # Download container from artifacts and import it |
| 5 | # e.g. with |
| 6 | # unxz -c < kalamar-master-fffe0d98.xz | docker load |
| 7 | # |
| 8 | image: docker:latest |
| 9 | |
| 10 | services: |
| 11 | - docker:dind |
| 12 | |
| 13 | build: |
| 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: |
| 26 | - docker build -f Dockerfile -t korap/kalamar:$VID-conv --target kalamar-convert . |
| 27 | - docker save korap/kalamar:$VID-conv | xz -T0 -M16G -9 > kalamar-$VID-conv.xz |
| 28 | artifacts: |
| 29 | paths: |
| 30 | - kalamar-$VID-conv.xz |
| 31 | |