Add remove/purge for netdata & composer
This commit is contained in:
@@ -62,4 +62,5 @@ script:
|
|||||||
- sudo wo info || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo info || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo tree -L 2 /etc/nginx
|
- sudo tree -L 2 /etc/nginx
|
||||||
- sudo wo update --travis || sudo tail -n50 /var/log/wo/wordops.log
|
- sudo wo update --travis || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
|
- sudo wo stack remove --netdata || sudo tail -n50 /var/log/wo/wordops.log
|
||||||
- sudo wo stack status
|
- sudo wo stack status
|
||||||
@@ -1824,6 +1824,14 @@ class WOStackController(CementBaseController):
|
|||||||
Log.debug(self, "Removing package variable of phpMyAdmin ")
|
Log.debug(self, "Removing package variable of phpMyAdmin ")
|
||||||
packages = packages + ['{0}22222/htdocs/db/pma'
|
packages = packages + ['{0}22222/htdocs/db/pma'
|
||||||
.format(WOVariables.wo_webroot)]
|
.format(WOVariables.wo_webroot)]
|
||||||
|
# Composer
|
||||||
|
if self.app.pargs.composer:
|
||||||
|
Log.debug(self, "Removing package variable of Composer ")
|
||||||
|
if os.path.isfile('/usr/local/bin/composer'):
|
||||||
|
packages = packages + ['/usr/local/bin/composer']
|
||||||
|
else:
|
||||||
|
Log.warn(self, "Composer is not installed with WordOps")
|
||||||
|
|
||||||
# PHPREDISADMIN
|
# PHPREDISADMIN
|
||||||
if self.app.pargs.phpredisadmin:
|
if self.app.pargs.phpredisadmin:
|
||||||
Log.debug(self, "Removing package variable of phpRedisAdmin ")
|
Log.debug(self, "Removing package variable of phpRedisAdmin ")
|
||||||
@@ -1848,6 +1856,12 @@ class WOStackController(CementBaseController):
|
|||||||
'{0}22222/htdocs/db/anemometer'
|
'{0}22222/htdocs/db/anemometer'
|
||||||
.format(WOVariables.wo_webroot)]
|
.format(WOVariables.wo_webroot)]
|
||||||
|
|
||||||
|
if self.app.pargs.netdata:
|
||||||
|
Log.debug(self, "Removing Netdata")
|
||||||
|
if os.path.isfile('/opt/netdata/usr/'
|
||||||
|
'libexec/netdata-uninstaller.sh'):
|
||||||
|
packages = packages + ['/var/lib/wo/tmp/kickstart.sh']
|
||||||
|
|
||||||
if (packages) or (apt_packages):
|
if (packages) or (apt_packages):
|
||||||
wo_prompt = input('Are you sure you to want to'
|
wo_prompt = input('Are you sure you to want to'
|
||||||
' remove from server.'
|
' remove from server.'
|
||||||
@@ -1862,6 +1876,13 @@ class WOStackController(CementBaseController):
|
|||||||
if (set(["nginx-custom"]).issubset(set(apt_packages))):
|
if (set(["nginx-custom"]).issubset(set(apt_packages))):
|
||||||
WOService.stop_service(self, 'nginx')
|
WOService.stop_service(self, 'nginx')
|
||||||
|
|
||||||
|
# Netdata uninstaller
|
||||||
|
if (set(['/var/lib/wo/tmp/'
|
||||||
|
'kickstart.sh']).issubset(set(packages))):
|
||||||
|
WOShellExec.cmd_exec(self, "bash /opt/netdata/usr/"
|
||||||
|
"libexec/netdata-"
|
||||||
|
"uninstaller.sh -y -f")
|
||||||
|
|
||||||
if (packages):
|
if (packages):
|
||||||
WOFileUtils.remove(self, packages)
|
WOFileUtils.remove(self, packages)
|
||||||
WOAptGet.auto_remove(self)
|
WOAptGet.auto_remove(self)
|
||||||
@@ -1907,6 +1928,8 @@ class WOStackController(CementBaseController):
|
|||||||
self.app.pargs.adminer = True
|
self.app.pargs.adminer = True
|
||||||
self.app.pargs.phpmyadmin = True
|
self.app.pargs.phpmyadmin = True
|
||||||
self.app.pargs.utils = True
|
self.app.pargs.utils = True
|
||||||
|
self.app.pargs.composer = True
|
||||||
|
self.app.pargs.netdata = True
|
||||||
|
|
||||||
# NGINX
|
# NGINX
|
||||||
if self.app.pargs.nginx:
|
if self.app.pargs.nginx:
|
||||||
@@ -1955,6 +1978,14 @@ class WOStackController(CementBaseController):
|
|||||||
format(WOVariables.wo_webroot)]
|
format(WOVariables.wo_webroot)]
|
||||||
Log.debug(self, "Purge package variable phpMyAdmin")
|
Log.debug(self, "Purge package variable phpMyAdmin")
|
||||||
|
|
||||||
|
# Composer
|
||||||
|
if self.app.pargs.composer:
|
||||||
|
Log.debug(self, "Removing package variable of Composer ")
|
||||||
|
if os.path.isfile('/usr/local/bin/composer'):
|
||||||
|
packages = packages + ['/usr/local/bin/composer']
|
||||||
|
else:
|
||||||
|
Log.warn(self, "Composer is not installed with WordOps")
|
||||||
|
|
||||||
# PHPREDISADMIN
|
# PHPREDISADMIN
|
||||||
if self.app.pargs.phpredisadmin:
|
if self.app.pargs.phpredisadmin:
|
||||||
Log.debug(self, "Removing package variable of phpRedisAdmin ")
|
Log.debug(self, "Removing package variable of phpRedisAdmin ")
|
||||||
@@ -1981,6 +2012,12 @@ class WOStackController(CementBaseController):
|
|||||||
.format(WOVariables.wo_webroot)
|
.format(WOVariables.wo_webroot)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if self.app.pargs.netdata:
|
||||||
|
Log.debug(self, "Removing Netdata")
|
||||||
|
if os.path.isfile('/opt/netdata/usr/'
|
||||||
|
'libexec/netdata-uninstaller.sh'):
|
||||||
|
packages = packages + ['/var/lib/wo/tmp/kickstart.sh']
|
||||||
|
|
||||||
if (packages) or (apt_packages):
|
if (packages) or (apt_packages):
|
||||||
wo_prompt = input('Are you sure you to want to purge '
|
wo_prompt = input('Are you sure you to want to purge '
|
||||||
'from server '
|
'from server '
|
||||||
@@ -1994,6 +2031,13 @@ class WOStackController(CementBaseController):
|
|||||||
if (set(["nginx-custom"]).issubset(set(apt_packages))):
|
if (set(["nginx-custom"]).issubset(set(apt_packages))):
|
||||||
WOService.stop_service(self, 'nginx')
|
WOService.stop_service(self, 'nginx')
|
||||||
|
|
||||||
|
# Netdata uninstaller
|
||||||
|
if (set(['/var/lib/wo/tmp/'
|
||||||
|
'kickstart.sh']).issubset(set(packages))):
|
||||||
|
WOShellExec.cmd_exec(self, "bash /opt/netdata/usr/"
|
||||||
|
"libexec/netdata-"
|
||||||
|
"uninstaller.sh -y -f")
|
||||||
|
|
||||||
if (apt_packages):
|
if (apt_packages):
|
||||||
Log.info(self, "Purging packages, please wait...")
|
Log.info(self, "Purging packages, please wait...")
|
||||||
WOAptGet.remove(self, apt_packages, purge=True)
|
WOAptGet.remove(self, apt_packages, purge=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user