8d3dd269a7db218a1698fed101b08d4199c42cc4
[csit.git] / resources / tools / presentation / run_cpta.sh
1 #!/bin/bash
2
3 set -x
4
5 # set default values in config array
6 typeset -A DIR
7
8 DIR[WORKING]=_tmp
9
10 # Create working directories
11 mkdir ${DIR[WORKING]}
12
13 # Create virtual environment
14 virtualenv -p $(which python3) ${DIR[WORKING]}/env
15 source ${DIR[WORKING]}/env/bin/activate
16
17 # FIXME: s3 config (until migrated to vault, then account will be reset)
18 mkdir -p ${HOME}/.aws
19 echo "[nomad-s3]" >> ${HOME}/.aws/config
20 echo "[nomad-s3]
21 aws_access_key_id = csit
22 aws_secret_access_key = Csit1234" >> ${HOME}/.aws/credentials
23
24 # Install python dependencies:
25 pip3 install -r requirements.txt
26
27 export PYTHONPATH=`pwd`:`pwd`/../../../:`pwd`/../../libraries/python
28
29 STATUS=$(python pal.py \
30     --specification specifications/trending \
31     --logging INFO \
32     --force)
33 RETURN_STATUS=$?
34
35 echo ${STATUS}
36 exit ${RETURN_STATUS}