blob: 729c300559ef97fe02e7bbed21a07733eb3f8508 [file] [log] [blame]
Marc Kupietz6dd64022023-11-18 21:30:56 +01001stages:
2 - build-and-test
3 - build-docker-image
Marc Kupietz6ac65072023-11-17 20:31:39 +01004
Marc Kupietz6dd64022023-11-18 21:30:56 +01005build-and-test:
6 image: rocker/tidyverse
7 stage: build-and-test
8 cache:
9 key: korap
10 paths:
11 - ./cache
12 before_script:
13 - source `find .. -name section_helper.sh`
Marc Kupietz6ac65072023-11-17 20:31:39 +010014
Marc Kupietz6dd64022023-11-18 21:30:56 +010015 - start_section install_linux_packages "Installing missing Linux packages"
16 - apt-get update
17 - apt-get install -y libu2f-udev build-essential libglpk40 libcurl4-gnutls-dev libxml2-dev libsodium-dev libsecret-1-dev libfontconfig1-dev libssl-dev libxt6 libpq-dev curl
18 - end_section install_linux_packages
19
20 - start_section install_r_packages "Installing missing R packages"
21 - R -e "install.packages(c('devtools', 'RKorAPClient', 'httr', 'shiny', 'shinythemes', 'highcharter'))"
22 - R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/idsThemeR")'
23 - end_section install_r_packages
24
25 script:
26 - start_section render "Running scripts"
27 - echo 'options(shiny.port=18000)' >> ~/.Rprofile
28 - R_CACHE_ROOTPATH=./cache Rscript shiny/app.R &
29 - PID=$!
30 - sleep 10
31 - curl http://127.0.0.1:18000/
32 - kill $PID
33 - end_section render
34
35build-docker-image:
36 image: docker:latest
37 services:
38 - docker:dind
Marc Kupietzf6bb6cb2023-11-18 17:17:50 +010039 rules:
40 - if: $CI_COMMIT_TAG =~ /.+/
41 variables:
42 VID: $CI_COMMIT_TAG
43 - when: manual
44 variables:
Marc Kupietz6dd64022023-11-18 21:30:56 +010045 VID_ALT: $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
46 VID: snapshot
47 stage: build-docker-image
Marc Kupietz6ac65072023-11-17 20:31:39 +010048 before_script:
Marc Kupietzf6bb6cb2023-11-18 17:17:50 +010049 - apk update
50 - apk add --no-cache git
Marc Kupietz6ac65072023-11-17 20:31:39 +010051 script:
Marc Kupietzf6bb6cb2023-11-18 17:17:50 +010052 - docker build -f Dockerfile -t korap/corpuscomposition:$VID .
53 - docker save korap/corpuscomposition:$VID | xz -T0 -M16G -9 > corpuscomposition-$VID.xz
54 artifacts:
55 paths:
56 - corpuscomposition-$VID.xz
57