forked from d101tm/tmstats
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdorealignment.sh
More file actions
executable file
·84 lines (77 loc) · 2.17 KB
/
dorealignment.sh
File metadata and controls
executable file
·84 lines (77 loc) · 2.17 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
. setup.sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/d101tm/lib/lib
# Make a directory for all of the products of this run
mkdir "${alignmentdir}" 2>/dev/null
export workfile="${alignmentdir}/d101align.csv"
# Process parameters
if [[ "$*" =~ .*include.* ]]
then
include=--include
else
include=""
fi
if [[ "$*" =~ .*html.* ]]
then
cat << EOF
Content-Type: text/html; charset=utf-8
<html>
<head><title>Running Alignment Programs</title></head>
<body>
EOF
bp="<pre>"
ep="</pre>"
else
bp=""
ep=""
fi
echo 'Running createalignment'
echo $bp
"$SCRIPTPATH"/createalignment.py $include --outfile $workfile || exit 1
echo $ep
echo
echo Running alignmap
echo $bp
"$SCRIPTPATH"/alignmap.py --pindir pins --district 101 --testalign $workfile --makedivisions --outdir "${alignmentdir}" || exit 2
echo $ep
echo
echo Running allstats
echo $bp
"$SCRIPTPATH"/allstats.py --outfile d101proforma.html --testalign $workfile --outdir "${alignmentdir}" --title "pro forma performance report" || exit 3
echo $ep
echo
echo Running makelocationreport with color
echo $bp
"$SCRIPTPATH"/makelocationreport.py --color --outfile d101details.html --infile $workfile --outdir "${alignmentdir}" || exit 4
echo $ep
echo
echo Running makelocationreport without color
echo $bp
"$SCRIPTPATH"/makelocationreport.py --infile $workfile --outfile d101location.html --outdir "${alignmentdir}" || exit 5
echo $ep
echo
echo Running clubchanges
echo $bp
"$SCRIPTPATH"/clubchanges.py --from $("$SCRIPTPATH"/getfirstdaywithdata.py) --outfile "${alignmentdir}"/changesthisyear.html
"$SCRIPTPATH"/clubchanges.py --from 3/17 --to 5/19 --outfile "${alignmentdir}"/changessincedecmeeting.html
echo $ep
echo
echo Running makealignmentpage
echo $bp
"$SCRIPTPATH"/makealignmentpage.py --fordec > "${alignmentdir}"/index.html
echo $ep
echo
if [[ "block15" == $(hostname) || "vps36552" == $(hostname) ]] ; then
echo "Copying to workingalignment"
mkdir ~/files/workingalignment 2>/dev/null
cp -RH "${alignmentdir}"/* ~/files/workingalignment/
fi
if [[ "$*" =~ .*html.* ]]
then
cat << EOF
<p>Go to <a href="/files/workingalignment"/">http://d101tm.org/files/workingalignment</a> to see the results.
</p>
</body>
</html>
EOF
fi