-
Notifications
You must be signed in to change notification settings - Fork 3
/
run.sh
executable file
·39 lines (29 loc) · 1.27 KB
/
run.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
#!/usr/bin/env bash
cd /home/clock/ospool-data
set -a
. ./secrets/gh_token
set +a
source venv/bin/activate
pip3 install -r requirements.txt &> /dev/null 2>&1
echo "----------------------------------------------------------\nRunning create_chtc_projects_on_ospool\n"
python3 create_chtc_projects_on_ospool.py
echo "----------------------------------------------------------\nRunning create_daily_ospool_report_json\n"
python3 create_daily_ospool_report_json.py
#echo "----------------------------------------------------------\nRunning create_active_facilities_report_json\n"
#python3 create_active_facilities_report_json.py
echo "----------------------------------------------------------\nRunning create_ospool_projects_report_json\n"
python3 create_ospool_projects_report_json.py
echo "----------------------------------------------------------\nRunning create_ospool_resources_report_json\n"
python3 create_ospool_resources_report_json.py
# Check that data was added since the last run
git diff-index --quiet HEAD
returnValue=$?
# If new data was added then push it
if [ $returnValue -ne 0 ]
then
git fetch --all
git merge origin/master
find data -name '*.json' | xargs git add
git commit -m "Update Data"
git push https://CannonLock:[email protected]/osg-htc/ospool-data.git
fi