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