forked from turicas/covid19-br
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·36 lines (27 loc) · 908 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e
SCRIPT_PATH=$(dirname ${BASH_SOURCE[0]})
source $SCRIPT_PATH/base.sh
function upload_table_file() {
table=$1
log "[$table] Copying data to static file server"
s3cmd put data/output/${table}.csv.gz s3://dataset/$DATASET/${table}.csv.gz
}
function update_table() {
table=$1
log "[$table] Executing update command"
ssh $BRASILIO_SSH_USER@$BRASILIO_SSH_SERVER "$BRASILIO_UPDATE_COMMAND $DATASET $table"
}
log "Cleaning data path and collecting data"
./run-obitos.sh
./run.sh
source $SCRIPT_PATH/.env
for table in boletim caso caso_full obito_cartorio; do
upload_table_file $table
update_table $table
done
log "Generating file list page"
python create_html.py dataset $DATASET $(date +"%Y-%m-%d") $SCRIPT_PATH/data/output/
s3cmd put data/output/SHA512SUMS s3://dataset/$DATASET/SHA512SUMS
s3cmd put data/output/_meta/list.html s3://dataset/$DATASET/_meta/list.html
./report.sh