@@ -30,10 +30,10 @@ def mysql_backup_db(db_name, build, fail_build=False, mysql_config='/etc/mysql/d
30
30
def database_updates (repo , branch , build , www_root , application_directory , db_name ):
31
31
print "Applying database updates."
32
32
with settings (warn_only = True ):
33
- with cd ("%s/%s_%s_%s/%s" % (www_root , repo , branch , application_directory )):
34
- if run ("su -s /bin/bash www-data -c 'console core:update'" ).failed :
35
- print "Could not run database updates. Reverting database and aborting."
33
+ with cd ("%s/%s_%s_%s/%s" % (www_root , repo , branch , build , application_directory )):
34
+ if sudo ("su -s /bin/bash www-data -c './console core:update'" ).failed :
36
35
execute (Revert ._revert_db , repo , branch , build , db_name )
36
+ raise SystemExit ("###### Could not run database updates. Reverting database and aborting." )
37
37
38
38
39
39
# Clear Matomo cache
@@ -42,8 +42,8 @@ def database_updates(repo, branch, build, www_root, application_directory, db_na
42
42
def clear_cache (repo , branch , build , www_root , application_directory ):
43
43
print "Clearing cache."
44
44
with settings (warn_only = True ):
45
- with cd ("%s/%s_%s_%s/%s" % (www_root , repo , branch , application_directory )):
46
- if run ("su -s /bin/bash www-data -c 'console cache:clear'" ).failed :
45
+ with cd ("%s/%s_%s_%s/%s" % (www_root , repo , branch , build , application_directory )):
46
+ if sudo ("su -s /bin/bash www-data -c './ console cache:clear'" ).failed :
47
47
print "Could not clear the cache. Not failing the build though."
48
48
49
49
0 commit comments