Fix netdata upgrade and install, download latest wp-cli
This commit is contained in:
@@ -910,10 +910,7 @@ def site_package_check(self, stype):
|
||||
if stype in ['wp', 'wpsubdir', 'wpsubdomain']:
|
||||
Log.debug(self, "Setting packages variable for WP-CLI")
|
||||
if not WOAptGet.is_exec(self, "wp"):
|
||||
packages = packages + [["https://github.com/wp-cli/wp-cli/"
|
||||
"releases/download/v{0}/"
|
||||
"wp-cli-{0}.phar"
|
||||
.format(WOVar.wo_wp_cli),
|
||||
packages = packages + [[f"{WOVar.wpcli_url}",
|
||||
"/usr/local/bin/wp", "WP-CLI"]]
|
||||
if pargs.wpredis:
|
||||
Log.debug(self, "Setting apt_packages variable for redis")
|
||||
|
||||
@@ -223,10 +223,7 @@ class WOStackController(CementBaseController):
|
||||
if pargs.wpcli:
|
||||
Log.debug(self, "Setting packages variable for WP-CLI")
|
||||
if not WOAptGet.is_exec(self, 'wp'):
|
||||
packages = packages + [["https://github.com/wp-cli/wp-cli/"
|
||||
"releases/download/v{0}/"
|
||||
"wp-cli-{0}.phar"
|
||||
"".format(WOVar.wo_wp_cli),
|
||||
packages = packages + [[f"{WOVar.wpcli_url}"
|
||||
"/usr/local/bin/wp",
|
||||
"WP-CLI"]]
|
||||
else:
|
||||
@@ -371,8 +368,7 @@ class WOStackController(CementBaseController):
|
||||
os.path.isdir("/etc/netdata")):
|
||||
Log.debug(
|
||||
self, "Setting packages variable for Netdata")
|
||||
packages = packages + [['https://my-netdata.io/'
|
||||
'kickstart.sh',
|
||||
packages = packages + [[f"{WOVar.netdata_script_url}",
|
||||
'/var/lib/wo/tmp/kickstart.sh',
|
||||
'Netdata']]
|
||||
else:
|
||||
|
||||
@@ -1152,25 +1152,18 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
||||
Log.wait(self, "Installing Netdata")
|
||||
WOShellExec.cmd_exec(
|
||||
self, "bash /var/lib/wo/tmp/kickstart.sh "
|
||||
"--dont-wait --no-updates --stable-channel "
|
||||
"--reinstall-even-if-unsafe",
|
||||
"--dont-wait --stable-channel",
|
||||
errormsg='', log=False)
|
||||
Log.valide(self, "Installing Netdata")
|
||||
|
||||
# disable mail notifications
|
||||
if os.path.isdir('/usr/lib/netdata/conf.d/health_alarm_notify.conf'):
|
||||
if os.path.exists('/usr/lib/netdata/conf.d/health_alarm_notify.conf'):
|
||||
WOFileUtils.searchreplace(
|
||||
self, "/usr/lib/netdata/conf.d/health_alarm_notify.conf",
|
||||
'SEND_EMAIL="YES"',
|
||||
'SEND_EMAIL="NO"')
|
||||
|
||||
if os.path.isdir('/opt/netdata/etc/netdata/health_alarm_notify.conf'):
|
||||
WOFileUtils.searchreplace(
|
||||
self, "/opt/netdata/etc/netdata/health_alarm_notify.conf",
|
||||
'SEND_EMAIL="YES"',
|
||||
'SEND_EMAIL="NO"')
|
||||
|
||||
if os.path.isdir('/etc/netdata/orig/health_alarm_notify.conf'):
|
||||
if os.path.exists('/etc/netdata/orig/health_alarm_notify.conf'):
|
||||
WOFileUtils.searchreplace(
|
||||
self, "/etc/netdata/orig/health_alarm_notify.conf",
|
||||
'SEND_EMAIL="YES"',
|
||||
|
||||
@@ -168,10 +168,7 @@ class WOStackUpgradeController(CementBaseController):
|
||||
# wp-cli
|
||||
if pargs.wpcli:
|
||||
if os.path.isfile('/usr/local/bin/wp'):
|
||||
packages = packages + [[
|
||||
"https://github.com/wp-cli/wp-cli/"
|
||||
"releases/download/v{0}/"
|
||||
"wp-cli-{0}.phar".format(WOVar.wo_wp_cli),
|
||||
packages = packages + [[f"{WOVar.wpcli_url}",
|
||||
"/usr/local/bin/wp",
|
||||
"WP-CLI"]]
|
||||
else:
|
||||
@@ -183,7 +180,7 @@ class WOStackUpgradeController(CementBaseController):
|
||||
if (os.path.isdir('/opt/netdata') or
|
||||
os.path.isdir('/etc/netdata')):
|
||||
packages = packages + [[
|
||||
'https://my-netdata.io/kickstart.sh',
|
||||
f"{WOVar.netdata_script_url}",
|
||||
'/var/lib/wo/tmp/kickstart.sh', 'Netdata']]
|
||||
else:
|
||||
Log.info(self, 'Netdata is not installed')
|
||||
@@ -356,6 +353,11 @@ class WOStackUpgradeController(CementBaseController):
|
||||
# Netdata
|
||||
if WOAptGet.is_selected(self, 'Netdata', packages):
|
||||
WOService.stop_service(self, 'netdata')
|
||||
if os.path.exists('/opt/netdata/usr/libexec/netdata/netdata-uninstaller.sh'):
|
||||
WOShellExec.cmd_exec(self,
|
||||
"/opt/netdata/usr/libexec/"
|
||||
"netdata/netdata-uninstaller.sh --yes --force",
|
||||
log=False)
|
||||
Log.wait(self, "Upgrading Netdata")
|
||||
# detect static binaries install
|
||||
WOShellExec.cmd_exec(
|
||||
|
||||
@@ -17,13 +17,13 @@ class WOVar():
|
||||
# WordOps version
|
||||
wo_version = "3.21.0"
|
||||
# WordOps packages versions
|
||||
wo_wp_cli = "2.10.0"
|
||||
wo_adminer = "4.8.1"
|
||||
wo_phpmyadmin = "5.2.0"
|
||||
wo_extplorer = "2.1.15"
|
||||
wo_dashboard = "1.3"
|
||||
|
||||
# Get WPCLI path
|
||||
wpcli_url = "https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar"
|
||||
wo_wpcli_path = '/usr/local/bin/wp'
|
||||
|
||||
# Current date and time of System
|
||||
@@ -211,6 +211,8 @@ class WOVar():
|
||||
|
||||
wo_redis = ['redis-server']
|
||||
|
||||
netdata_script_url = "https://get.netdata.cloud/kickstart.sh"
|
||||
|
||||
# Repo path
|
||||
wo_repo_file = "wo-repo.list"
|
||||
wo_repo_file_path = ("/etc/apt/sources.list.d/" + wo_repo_file)
|
||||
|
||||
Reference in New Issue
Block a user