From 3e928cd43e7ee649c7d9b2826233f18c5072196a Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Tue, 2 Apr 2019 01:59:40 +0200 Subject: [PATCH] add netdata --- .travis.yml | 2 +- CHANGELOG.md | 2 ++ wo/cli/plugins/stack.py | 31 ++++++++++++++++++++++++++++--- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8821465..dc63fb7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,4 +64,4 @@ script: - sudo bash -c 'tar -I pigz -cf wordops.tar.gz /var/log/wo' - sudo curl --progress-bar --upload-file "wordops.tar.gz" https://transfer.vtbox.net/$(basename wordops.tar.gz) && echo "" || sudo echo "transfer.sh is down" - sudo tree -L 2 /etc/nginx - - sudo tree -L 2 /var/www/22222 + - sudo tree -L 4 /var/www/22222 diff --git a/CHANGELOG.md b/CHANGELOG.md index ed661d9..07c70dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Previous acme.sh certs migration - "wo maintenance" command to perform server package update & cleanup - Support for Netdata on backend : https://server.hostname:22222/netdata/ +- Stack : composer and netdata #### Changed @@ -51,6 +52,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - EasyEngine database sync during migration - command "wo info" - phpmyadmin install with composer +- command "wo clean --memcached" ### v3.9.4 - 2019-03-15 diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index 8b02d52..59377b7 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -66,7 +66,8 @@ class WOStackController(CementBaseController): (['--composer'], dict(help='Install Composer stack', action='store_true')), (['--netdata'], - dict(help='Install Netdata monitoring suite', action='store_true')), + dict(help='Install Netdata monitoring suite', + action='store_true')), (['--adminer'], dict(help='Install Adminer stack', action='store_true')), (['--utils'], @@ -1067,6 +1068,17 @@ class WOStackController(CementBaseController): WOVariables.wo_php_user, recursive=True) + if any('/tmp/netdata.tar.gz' == x[1] + for x in packages): + if not os.path.exists('/etc/netdata'): + Log.debug(self, "Extracting netdata.tar.gz to location" + "/usr/src/netdata.git/") + WOExtract.extract(self, '/tmp/netdata.tar.gz', '/tmp/') + WOShellExec.cmd_exec(self, "/tmp/netdata-v1.13.0/" + "netdata-installer.sh " + "--stable-channel " + "--dont-wait") + if any('/tmp/webgrind.tar.gz' == x[1] for x in packages): Log.debug(self, "Extracting file webgrind.tar.gz to " @@ -1333,13 +1345,24 @@ class WOStackController(CementBaseController): # ADMINER if self.app.pargs.adminer: Log.debug(self, "Setting packages variable for Adminer ") - packages = packages + [["https://www.adminer.org/static/download/" - "{0}/adminer-{0}.php" + packages = packages + [["https://www.adminer.org/static/" + "download/{0}/adminer-{0}.php" "".format(WOVariables.wo_adminer), "{0}22222/" "htdocs/db/adminer/index.php" .format(WOVariables.wo_webroot), "Adminer"]] + # Netdata + if self.app.pargs.netdata: + Log.debug(self, "Setting packages variable for Netdata") + if not os.path.exists('/etc/netdata'): + packages = packages + [['https://github.com/' + 'netdata/netdata/releases/' + 'download/v1.13.0/' + 'netdata-v1.13.0.tar.gz', + '/tmp/netdata.tar.gz', + 'netdata']] + # UTILS if self.app.pargs.utils: Log.debug(self, "Setting packages variable for utils") @@ -1453,6 +1476,7 @@ class WOStackController(CementBaseController): (not self.app.pargs.php73) and (not self.app.pargs.mysql) and (not self.app.pargs.wpcli) and (not self.app.pargs.phpmyadmin) and (not self.app.pargs.adminer) and (not self.app.pargs.utils) and + (not self.app.pargs.composer) and (not self.app.pargs.netdata) (not self.app.pargs.all) and (not self.app.pargs.redis) and (not self.app.pargs.phpredisadmin)): self.app.pargs.web = True @@ -1589,6 +1613,7 @@ class WOStackController(CementBaseController): (not self.app.pargs.php73) and (not self.app.pargs.mysql) and (not self.app.pargs.wpcli) and (not self.app.pargs.phpmyadmin) and (not self.app.pargs.adminer) and (not self.app.pargs.utils) and + (not self.app.pargs.composer) and (not self.app.pargs.netdata) (not self.app.pargs.all) and (not self.app.pargs.redis) and (not self.app.pargs.phpredisadmin)): self.app.pargs.web = True