Merge pull request #3063 from csmithATsquiz/daily_autoupdate

Disabling auto-updates doesn't work
This commit is contained in:
Neil Lathwood
2016-02-26 11:39:40 +00:00
2 changed files with 21 additions and 13 deletions
+11 -12
View File
@@ -18,6 +18,10 @@ if (isset($options['d'])) {
}
if ($options['f'] === 'update') {
if (!$config['update']) {
exit(0);
}
$innodb_buffer = innodb_buffer_check();
if ($innodb_buffer['used'] > $innodb_buffer['size']) {
if (!empty($config['alert']['default_mail'])) {
@@ -39,19 +43,14 @@ The ' . $config['project_name'] . ' team.';
echo warn_innodb_buffer($innodb_buffer);
exit(2);
}
else {
if ($config['update']) {
if ($config['update_channel'] == 'master') {
exit(1);
}
elseif ($config['update_channel'] == 'release') {
exit(3);
}
}
else {
exit(0);
}
if ($config['update_channel'] == 'master') {
exit(1);
}
elseif ($config['update_channel'] == 'release') {
exit(3);
}
exit(0);
}
if ($options['f'] === 'syslog') {
+10 -1
View File
@@ -33,7 +33,10 @@ status_run() {
if [ -z "$arg" ]; then
up=$(php daily.php -f update >&2; echo $?)
if [ "$up" -eq 1 ]; then
if [ "$up" -eq 0 ]; then
$0 no-code-update
exit
elif [ "$up" -eq 1 ]; then
# Update to Master-Branch
status_run 'Updating to latest codebase' 'git pull --quiet'
elif [ "$up" -eq 3 ]; then
@@ -49,6 +52,12 @@ if [ -z "$arg" ]; then
fi
else
case $arg in
no-code-update)
# Updates of the code are disabled, just check for schema updates
# and clean up the db.
status_run 'Updating SQL-Schema' 'php includes/sql-schema/update.php'
status_run 'Cleaning up DB' "$0 cleanup"
;;
post-pull)
# List all tasks to do after pull in the order of execution
status_run 'Updating SQL-Schema' 'php includes/sql-schema/update.php'