Browse Source

Merge branch 'master' of github.com:rtcamp/easyengine

release/v3.3.0
gau1991 10 years ago
parent
commit
c5dbffc7b2
  1. 5
      CHANGELOG.txt
  2. 3
      ee/cli/plugins/site_functions.py
  3. 3
      ee/cli/plugins/stack.py
  4. 63
      ee/cli/plugins/stack_services.py
  5. 2
      ee/cli/plugins/stack_upgrade.py
  6. 39
      ee/core/services.py
  7. 2
      ee/core/variables.py
  8. 2
      install
  9. 2
      setup.py

5
CHANGELOG.txt

@ -1,3 +1,8 @@
v 3.1.8 - May 22, 2015
- Fixed PHP Failed to Restart after Upgrade #550
- Improved ee stack services command
- Minor fix and improvements
v 3.1.7 - May 21, 2015 v 3.1.7 - May 21, 2015
- Fixed site blank issue after nginx stack upgrade on Debian - Fixed site blank issue after nginx stack upgrade on Debian
- Improved update script - Improved update script

3
ee/cli/plugins/site_functions.py

@ -17,6 +17,7 @@ import sys
import getpass import getpass
import glob import glob
import re import re
import platform
class SiteError(Exception): class SiteError(Exception):
@ -604,6 +605,8 @@ def site_package_check(self, stype):
"/usr/bin/wp", "WP-CLI"]] "/usr/bin/wp", "WP-CLI"]]
if self.app.pargs.hhvm: if self.app.pargs.hhvm:
if platform.architecture()[0] is '32bit':
Log.error(self, "HHVM is not supported by 32bit system")
Log.debug(self, "Setting apt_packages variable for HHVM") Log.debug(self, "Setting apt_packages variable for HHVM")
if not EEAptGet.is_installed(self, 'hhvm'): if not EEAptGet.is_installed(self, 'hhvm'):
apt_packages = apt_packages + EEVariables.ee_hhvm apt_packages = apt_packages + EEVariables.ee_hhvm

3
ee/cli/plugins/stack.py

@ -25,6 +25,7 @@ import os
import pwd import pwd
import grp import grp
import codecs import codecs
import platform
from ee.cli.plugins.stack_services import EEStackStatusController from ee.cli.plugins.stack_services import EEStackStatusController
from ee.cli.plugins.stack_migrate import EEStackMigrateController from ee.cli.plugins.stack_migrate import EEStackMigrateController
from ee.cli.plugins.stack_upgrade import EEStackUpgradeController from ee.cli.plugins.stack_upgrade import EEStackUpgradeController
@ -1494,6 +1495,8 @@ class EEStackController(CementBaseController):
if self.app.pargs.hhvm: if self.app.pargs.hhvm:
Log.debug(self, "Setting apt packages variable for HHVM") Log.debug(self, "Setting apt packages variable for HHVM")
if platform.architecture()[0] is '32bit':
Log.error(self, "HHVM is not supported by 32bit system")
if not EEAptGet.is_installed(self, 'hhvm'): if not EEAptGet.is_installed(self, 'hhvm'):
apt_packages = apt_packages + EEVariables.ee_hhvm apt_packages = apt_packages + EEVariables.ee_hhvm
else: else:

63
ee/cli/plugins/stack_services.py

@ -51,11 +51,18 @@ class EEStackStatusController(CementBaseController):
Log.info(self, "PHP5-FPM is not installed") Log.info(self, "PHP5-FPM is not installed")
if self.app.pargs.mysql: if self.app.pargs.mysql:
if EEVariables.ee_mysql_host is "localhost": if ((EEVariables.ee_mysql_host is "localhost") or
(EEVariables.ee_mysql_host is "127.0.0.1")):
if (EEAptGet.is_installed(self, 'mysql-server') or
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
EEAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql'] services = services + ['mysql']
else: else:
Log.warn(self, "Remote MySQL found," Log.info(self, "MySQL is not installed")
"Unable to start MySQL service") else:
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.postfix: if self.app.pargs.postfix:
if EEAptGet.is_installed(self, 'postfix'): if EEAptGet.is_installed(self, 'postfix'):
services = services + ['postfix'] services = services + ['postfix']
@ -115,11 +122,18 @@ class EEStackStatusController(CementBaseController):
Log.info(self, "PHP5-FPM is not installed") Log.info(self, "PHP5-FPM is not installed")
if self.app.pargs.mysql: if self.app.pargs.mysql:
if EEVariables.ee_mysql_host is "localhost": if ((EEVariables.ee_mysql_host is "localhost") or
(EEVariables.ee_mysql_host is "127.0.0.1")):
if (EEAptGet.is_installed(self, 'mysql-server') or
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
EEAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql'] services = services + ['mysql']
else: else:
Log.warn(self, "Remote MySQL found," Log.info(self, "MySQL is not installed")
"Unable to stop MySQL service") else:
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.postfix: if self.app.pargs.postfix:
if EEAptGet.is_installed(self, 'postfix'): if EEAptGet.is_installed(self, 'postfix'):
services = services + ['postfix'] services = services + ['postfix']
@ -179,11 +193,18 @@ class EEStackStatusController(CementBaseController):
Log.info(self, "PHP5-FPM is not installed") Log.info(self, "PHP5-FPM is not installed")
if self.app.pargs.mysql: if self.app.pargs.mysql:
if EEVariables.ee_mysql_host is "localhost": if ((EEVariables.ee_mysql_host is "localhost") or
(EEVariables.ee_mysql_host is "127.0.0.1")):
if (EEAptGet.is_installed(self, 'mysql-server') or
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
EEAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql'] services = services + ['mysql']
else: else:
Log.warn(self, "Remote MySQL found," Log.info(self, "MySQL is not installed")
"Unable to restart MySQL service") else:
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.postfix: if self.app.pargs.postfix:
if EEAptGet.is_installed(self, 'postfix'): if EEAptGet.is_installed(self, 'postfix'):
services = services + ['postfix'] services = services + ['postfix']
@ -243,11 +264,18 @@ class EEStackStatusController(CementBaseController):
Log.info(self, "PHP5-FPM is not installed") Log.info(self, "PHP5-FPM is not installed")
if self.app.pargs.mysql: if self.app.pargs.mysql:
if EEVariables.ee_mysql_host is "localhost": if ((EEVariables.ee_mysql_host is "localhost") or
(EEVariables.ee_mysql_host is "127.0.0.1")):
if (EEAptGet.is_installed(self, 'mysql-server') or
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
EEAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql'] services = services + ['mysql']
else: else:
Log.warn(self, "Remote MySQL found," Log.info(self, "MySQL is not installed")
else:
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status") "Unable to check MySQL service status")
if self.app.pargs.postfix: if self.app.pargs.postfix:
if EEAptGet.is_installed(self, 'postfix'): if EEAptGet.is_installed(self, 'postfix'):
services = services + ['postfix'] services = services + ['postfix']
@ -306,11 +334,18 @@ class EEStackStatusController(CementBaseController):
Log.info(self, "PHP5-FPM is not installed") Log.info(self, "PHP5-FPM is not installed")
if self.app.pargs.mysql: if self.app.pargs.mysql:
if EEVariables.ee_mysql_host is "localhost": if ((EEVariables.ee_mysql_host is "localhost") or
(EEVariables.ee_mysql_host is "127.0.0.1")):
if (EEAptGet.is_installed(self, 'mysql-server') or
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
EEAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql'] services = services + ['mysql']
else: else:
Log.warn(self, "Remote MySQL found," Log.info(self, "MySQL is not installed")
"Unable to reload MySQL service") else:
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.postfix: if self.app.pargs.postfix:
if EEAptGet.is_installed(self, 'postfix'): if EEAptGet.is_installed(self, 'postfix'):
services = services + ['postfix'] services = services + ['postfix']

2
ee/cli/plugins/stack_upgrade.py

@ -216,7 +216,7 @@ class EEStackUpgradeController(CementBaseController):
EEService.restart_service(self, 'nginx') EEService.restart_service(self, 'nginx')
if set(EEVariables.ee_php).issubset(set(apt_packages)): if set(EEVariables.ee_php).issubset(set(apt_packages)):
EEService.restart_service(self, 'php') EEService.restart_service(self, 'php5-fpm')
if set(EEVariables.ee_hhvm).issubset(set(apt_packages)): if set(EEVariables.ee_hhvm).issubset(set(apt_packages)):
EEService.restart_service(self, 'hhvm') EEService.restart_service(self, 'hhvm')
if set(EEVariables.ee_postfix).issubset(set(apt_packages)): if set(EEVariables.ee_postfix).issubset(set(apt_packages)):

39
ee/core/services.py

@ -18,9 +18,14 @@ class EEService():
Similar to `service xyz start` Similar to `service xyz start`
""" """
try: try:
Log.info(self, "Start : {0:10}" .format(service_name), end='') if service_name in ['nginx', 'php5-fpm']:
retcode = subprocess.getstatusoutput('service {0} start' service_cmd = ('{0} -t && service {0} start'
.format(service_name)) .format(service_name))
else:
service_cmd = ('service {0} start'.format(service_name))
Log.info(self, "Start : {0:10}" .format(service_name), end='')
retcode = subprocess.getstatusoutput(service_cmd)
if retcode[0] == 0: if retcode[0] == 0:
Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]")
return True return True
@ -60,9 +65,14 @@ class EEService():
Similar to `service xyz restart` Similar to `service xyz restart`
""" """
try: try:
Log.info(self, "Restart : {0:10}".format(service_name), end='') if service_name in ['nginx', 'php5-fpm']:
retcode = subprocess.getstatusoutput('service {0} restart' service_cmd = ('{0} -t && service {0} restart'
.format(service_name)) .format(service_name))
else:
service_cmd = ('service {0} restart'.format(service_name))
Log.info(self, "Restart : {0:10}".format(service_name), end='')
retcode = subprocess.getstatusoutput(service_cmd)
if retcode[0] == 0: if retcode[0] == 0:
Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]")
return True return True
@ -82,26 +92,13 @@ class EEService():
""" """
try: try:
if service_name in ['nginx', 'php5-fpm']: if service_name in ['nginx', 'php5-fpm']:
Log.info(self, "Reload : {0:10}".format(service_name), service_cmd = ('{0} -t && service {0} reload'
end='')
retcode = subprocess.getstatusoutput('{0} -t &&'
' service {0} reload'
.format(service_name)) .format(service_name))
if retcode[0] == 0:
# print(retcode[0])
# subprocess.getstatusoutput('service {0} reload'
# .format(service_name))
Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE +
"]")
return True
else: else:
Log.debug(self, "{0}".format(retcode[1])) service_cmd = ('service {0} reload'.format(service_name))
Log.info(self, "[" + Log.FAIL + "Failed" +
Log.OKBLUE+"]")
return False
Log.info(self, "Reload : {0:10}".format(service_name), end='') Log.info(self, "Reload : {0:10}".format(service_name), end='')
retcode = subprocess.getstatusoutput('service {0} reload' retcode = subprocess.getstatusoutput(service_cmd)
.format(service_name))
if retcode[0] == 0: if retcode[0] == 0:
Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]") Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]")
return True return True

2
ee/core/variables.py

@ -12,7 +12,7 @@ class EEVariables():
"""Intialization of core variables""" """Intialization of core variables"""
# EasyEngine version # EasyEngine version
ee_version = "3.1.7" ee_version = "3.1.8"
# EasyEngine packages versions # EasyEngine packages versions
ee_wp_cli = "0.19.1" ee_wp_cli = "0.19.1"

2
install

@ -48,7 +48,7 @@ fi
# Define variables for later use # Define variables for later use
ee_branch=$1 ee_branch=$1
readonly ee_version_old="2.2.3" readonly ee_version_old="2.2.3"
readonly ee_version_new="3.1.7" readonly ee_version_new="3.1.8"
readonly ee_log_dir=/var/log/ee/ readonly ee_log_dir=/var/log/ee/
readonly ee_install_log=/var/log/ee/install.log readonly ee_install_log=/var/log/ee/install.log
readonly ee_linux_distro=$(lsb_release -i | awk '{print $3}') readonly ee_linux_distro=$(lsb_release -i | awk '{print $3}')

2
setup.py

@ -54,7 +54,7 @@ except Exception as e:
os.system("git config --global user.email {0}".format(ee_email)) os.system("git config --global user.email {0}".format(ee_email))
setup(name='ee', setup(name='ee',
version='3.1.7', version='3.1.8',
description=long_description, description=long_description,
long_description=long_description, long_description=long_description,
classifiers=[], classifiers=[],

Loading…
Cancel
Save