forked from reichlab/covid19-forecast-hub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis-main.sh
executable file
·63 lines (51 loc) · 1.71 KB
/
travis-main.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
set -e
if [[ "$TRAVIS_COMMIT_MESSAGE" == "[TRAVIS] Autogenerated files from travis" ]]; then
echo "This is an auto commit from travis. Not doing anything."
exit 0
fi
if [[ "$TRAVIS_BRANCH" != "master" ]]; then
echo "Not on master. Not doing anything else."
exit 0
fi
#if [[ "$TRAVIS_COMMIT_MESSAGE" != *"trigger build"* ]]; then
# echo "Do not trigger build. Exiting..."
# exit 0
#fi
# Save some useful information
REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//[email protected]:}
SHA=`git rev-parse --verify HEAD`
echo "Running test script..."
npm install
sudo apt-get install python3-pandas
sudo apt install python3-pip
pip3 install --upgrade setuptools
pip3 install pymmwr click requests urllib3 selenium webdriver-manager pyyaml
pip3 install git+https://github.com/reichlab/zoltpy/
source ./travis/validate-data.sh
echo "build complete"
if [[ "$TRAVIS_EVENT_TYPE" == *"cron"* ]]; then
echo "updating model data..."
bash ./travis/pull-data.sh
fi
if [[ "$TRAVIS_COMMIT_MESSAGE" == *"update data"* ]]; then
echo "updating model data..."
bash ./travis/pull-data.sh
fi
if [[ "$TRAVIS_COMMIT_MESSAGE" == *"Merge pull request"* ]]; then
echo "Merge detected.. push to github"
bash ./travis/push.sh
echo "Upload forecasts to Zoltar"
bash ./travis/upload-to-zoltar.sh
echo "replace validated files"
cp ./code/validation/locally_validated_files.csv ./code/validation/validated_files.csv
fi
if [[ "$TRAVIS_COMMIT_MESSAGE" == *"trigger build"* ]]; then
source ./travis/vis.sh
source ./travis/push.sh
fi
if [[ "$TRAVIS_COMMIT_MESSAGE" == *"test zoltar"* ]]; then
echo "Upload forecasts to Zoltar"
bash ./travis/upload-to-zoltar.sh
fi