blob: 729c300559ef97fe02e7bbed21a07733eb3f8508 [file] [log] [blame]
stages:
- build-and-test
- build-docker-image
build-and-test:
image: rocker/tidyverse
stage: build-and-test
cache:
key: korap
paths:
- ./cache
before_script:
- source `find .. -name section_helper.sh`
- start_section install_linux_packages "Installing missing Linux packages"
- apt-get update
- 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
- end_section install_linux_packages
- start_section install_r_packages "Installing missing R packages"
- R -e "install.packages(c('devtools', 'RKorAPClient', 'httr', 'shiny', 'shinythemes', 'highcharter'))"
- R -e 'devtools::install_git("https://korap.ids-mannheim.de/gerrit/IDS-Mannheim/idsThemeR")'
- end_section install_r_packages
script:
- start_section render "Running scripts"
- echo 'options(shiny.port=18000)' >> ~/.Rprofile
- R_CACHE_ROOTPATH=./cache Rscript shiny/app.R &
- PID=$!
- sleep 10
- curl http://127.0.0.1:18000/
- kill $PID
- end_section render
build-docker-image:
image: docker:latest
services:
- docker:dind
rules:
- if: $CI_COMMIT_TAG =~ /.+/
variables:
VID: $CI_COMMIT_TAG
- when: manual
variables:
VID_ALT: $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
VID: snapshot
stage: build-docker-image
before_script:
- apk update
- apk add --no-cache git
script:
- docker build -f Dockerfile -t korap/corpuscomposition:$VID .
- docker save korap/corpuscomposition:$VID | xz -T0 -M16G -9 > corpuscomposition-$VID.xz
artifacts:
paths:
- corpuscomposition-$VID.xz