Marc Kupietz | f6bb6cb | 2023-11-18 17:17:50 +0100 | [diff] [blame] | 1 | # gitlab ci pipeline to build corpuscomposition docker container |
| 2 | # automatically triggered on tag pushes or run manually |
| 3 | # |
| 4 | # Download container from artifacts and import it |
| 5 | # e.g. with |
| 6 | # unxz -c < corpuscomposition-master-fffe0d98.xz | docker load |
| 7 | # |
| 8 | image: docker:latest |
Marc Kupietz | 6ac6507 | 2023-11-17 20:31:39 +0100 | [diff] [blame] | 9 | |
Marc Kupietz | f6bb6cb | 2023-11-18 17:17:50 +0100 | [diff] [blame] | 10 | services: |
| 11 | - docker:dind |
Marc Kupietz | 6ac6507 | 2023-11-17 20:31:39 +0100 | [diff] [blame] | 12 | |
Marc Kupietz | f6bb6cb | 2023-11-18 17:17:50 +0100 | [diff] [blame] | 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 |
Marc Kupietz | 6ac6507 | 2023-11-17 20:31:39 +0100 | [diff] [blame] | 21 | stage: build |
Marc Kupietz | 6ac6507 | 2023-11-17 20:31:39 +0100 | [diff] [blame] | 22 | before_script: |
Marc Kupietz | f6bb6cb | 2023-11-18 17:17:50 +0100 | [diff] [blame] | 23 | - apk update |
| 24 | - apk add --no-cache git |
Marc Kupietz | 6ac6507 | 2023-11-17 20:31:39 +0100 | [diff] [blame] | 25 | script: |
Marc Kupietz | f6bb6cb | 2023-11-18 17:17:50 +0100 | [diff] [blame] | 26 | - docker build -f Dockerfile -t korap/corpuscomposition:$VID . |
| 27 | - docker save korap/corpuscomposition:$VID | xz -T0 -M16G -9 > corpuscomposition-$VID.xz |
| 28 | artifacts: |
| 29 | paths: |
| 30 | - corpuscomposition-$VID.xz |
| 31 | |