Fix github actions

This commit is contained in:
VirtuBox
2020-10-28 11:45:30 +01:00
parent 4bca86580e
commit 164f817d25
3 changed files with 14 additions and 13 deletions

View File

@@ -237,7 +237,7 @@ echo -e "${CGREEN}#############################################${CEND}"
echo -ne " Upgrading mariadb [..]\r" echo -ne " Upgrading mariadb [..]\r"
if { if {
wo stack migrate --mariadb --force wo stack migrate --mariadb --force --ci
} >>/var/log/wo/test.log; then } >>/var/log/wo/test.log; then
echo -ne " Upgrading mariadb [${CGREEN}OK${CEND}]\\r" echo -ne " Upgrading mariadb [${CGREEN}OK${CEND}]\\r"
echo -ne '\n' echo -ne '\n'

View File

@@ -23,6 +23,10 @@ class WOStackMigrateController(CementBaseController):
(['--force'], (['--force'],
dict(help="Force Packages upgrade without any prompt", dict(help="Force Packages upgrade without any prompt",
action='store_true')), action='store_true')),
(['--ci'],
dict(help="Argument used for testing, "
"do not use it on your server",
action='store_true')),
] ]
@expose(hide=True) @expose(hide=True)
@@ -53,7 +57,8 @@ class WOStackMigrateController(CementBaseController):
WOAptGet.remove(self, ["mariadb-server"]) WOAptGet.remove(self, ["mariadb-server"])
WOAptGet.auto_remove(self) WOAptGet.auto_remove(self)
WOAptGet.install(self, WOVar.wo_mysql) WOAptGet.install(self, WOVar.wo_mysql)
WOAptGet.dist_upgrade(self) if not self.app.args.ci:
WOAptGet.dist_upgrade(self)
WOAptGet.auto_remove(self) WOAptGet.auto_remove(self)
Log.valide(self, "Upgrading MariaDB ") Log.valide(self, "Upgrading MariaDB ")
WOFileUtils.mvfile( WOFileUtils.mvfile(
@@ -70,6 +75,8 @@ class WOStackMigrateController(CementBaseController):
if ((not pargs.mariadb)): if ((not pargs.mariadb)):
self.app.args.print_help() self.app.args.print_help()
if pargs.mariadb: if pargs.mariadb:
if WOVar.wo_distro == 'raspbian':
Log.error(self, "MariaDB upgrade is not available on Raspbian")
if WOVar.wo_mysql_host != "localhost": if WOVar.wo_mysql_host != "localhost":
Log.error( Log.error(
self, "Remote MySQL server in use, skipping local install") self, "Remote MySQL server in use, skipping local install")

View File

@@ -158,25 +158,19 @@ class WOVar():
wo_php_extra = ["graphviz"] wo_php_extra = ["graphviz"]
wo_mysql = ["mariadb-server", "percona-toolkit"] wo_mysql = [
"mariadb-server", "percona-toolkit",
"mariadb-common", "python3-mysqldb"]
if wo_distro == 'raspbian': if wo_distro == 'raspbian':
wo_mysql = wo_mysql + ["python3-mysqldb"]
if wo_platform_codename == 'stretch': if wo_platform_codename == 'stretch':
mariadb_ver = '10.1' mariadb_ver = '10.1'
else: else:
mariadb_ver = '10.3' mariadb_ver = '10.3'
else: else:
mariadb_ver = '10.5' mariadb_ver = '10.5'
if wo_platform_codename == 'jessie': wo_mysql = wo_mysql + ["mariadb-backup"]
wo_mysql = wo_mysql + ["python3-mysql.connector"]
else:
wo_mysql = wo_mysql + ["python3-mysqldb", "mariadb-backup"]
wo_mysql_client = ["mariadb-client"] wo_mysql_client = ["mariadb-client", "python3-mysqldb"]
if wo_platform_codename == 'jessie':
wo_mysql_client = wo_mysql_client + ["python3-mysqldb"]
else:
wo_mysql_client = wo_mysql_client + ["python3-mysql.connector"]
wo_fail2ban = ["fail2ban"] wo_fail2ban = ["fail2ban"]
wo_clamav = ["clamav", "clamav-freshclam"] wo_clamav = ["clamav", "clamav-freshclam"]