-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkoha-git-upgrade.sh
executable file
·60 lines (49 loc) · 1.53 KB
/
koha-git-upgrade.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
#!/bin/bash
# Copyright 2008
# Chris Cormack [email protected]
# This is designed to be run as a cron job, and the output emailed
# It checks an install still works
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if [ $# -ne 4 ]; then
echo 1>&2 Usage: $0 path/to/git/repo path/to/koha-install-log opacurl emailaddress
exit 127
fi
# change to git repo
cd $1
#clean up so we do a fresh make
if make clean; then
echo "Cleaned up previous make";
else
echo "Clean not needed";
fi
# clean up dir
git clean -f
if git fetch; then
if git rebase origin; then
perl Makefile.PL --prev-install-log $2
make
make test
fi
fi
if make install; then
if wget --delete-after $3 2>&1 | grep "/cgi-bin/koha/maintenance.pl"; then
echo "Database upgrade needed" | mailx -s "Koha Database Needs Upgrade" $4
exit 127
else
echo "Upgrade finished";
fi
else
echo "Can't install" | mailx -s "Koha Installation failed" $4
exit 127
fi