3038ade2b453f839c40044fd90a463762b430a78
[csit.git] / resources / tools / presentation / run_report.sh
1 #!/bin/bash
2
3 set -x
4
5 RELEASE=$1
6
7 # set default values in config array
8 typeset -A CFG
9 typeset -A DIR
10
11 DIR[WORKING]=_tmp
12 CFG[BLD_LATEX]=1
13
14 # Install system dependencies
15 sudo apt-get -y update
16 sudo apt-get -y install libxml2 libxml2-dev libxslt-dev build-essential \
17     zlib1g-dev unzip
18
19 if [[ ${CFG[BLD_LATEX]} -eq 1 ]] ;
20 then
21     sudo apt-get -y install xvfb texlive-latex-recommended \
22         texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra latexmk wkhtmltopdf inkscape
23     sudo sed -i.bak 's/^\(main_memory\s=\s\).*/\110000000/' /usr/share/texlive/texmf-dist/web2c/texmf.cnf
24 fi
25
26 # Create working directories
27 mkdir ${DIR[WORKING]}
28
29 # Create virtual environment
30 virtualenv -p $(which python3) ${DIR[WORKING]}/env
31 source ${DIR[WORKING]}/env/bin/activate
32
33 # Install python dependencies:
34 pip3 install -r requirements.txt
35
36 export PYTHONPATH=`pwd`:`pwd`/../../../:`pwd`/../../libraries/python
37
38 python pal.py \
39     --specification specification.yaml \
40     --release ${RELEASE} \
41     --week "26" \
42     --logging INFO \
43     --force
44
45 RETURN_STATUS=$(echo $?)
46 exit ${RETURN_STATUS}