diff --git a/CHANGELOG.txt b/CHANGELOG.txt index f7d03a31..018ce4d3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,7 @@ +v 3.3.12 - Nov 3, 2015 +- Fix #637 +- Updated wp-cli version + v 3.3.11 - Oct 26, 2015 - Updated MySql version - Added new repository for MySql diff --git a/ee/cli/plugins/site.py b/ee/cli/plugins/site.py index 78ae6e77..45c8709c 100644 --- a/ee/cli/plugins/site.py +++ b/ee/cli/plugins/site.py @@ -1013,7 +1013,7 @@ class EESiteUpdateController(CementBaseController): Log.info(self, "Pagespeed is already disabled for given " "site") elif pagespeed is True: - Log.info(self, "Pagespeed is allready enabled for given " + Log.info(self, "Pagespeed is already enabled for given " "site") pargs.pagespeed = False @@ -1120,6 +1120,8 @@ class EESiteUpdateController(CementBaseController): Log.debug(self, str(e)) Log.error(self, "NGINX configuration check failed.") + data['old_pagespeed_status'] = check_site.is_pagespeed + try: sitebackup(self, data) except Exception as e: diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index 2e6a65d3..8ce33970 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -605,7 +605,7 @@ def setwebrootpermissions(self, webroot): EEVariables.ee_php_user, recursive=True) except Exception as e: Log.debug(self, str(e)) - raise SiteError("problem occured while settingup webroot permissions") + raise SiteError("problem occured while setting up webroot permissions") def sitebackup(self, data): @@ -618,9 +618,14 @@ def sitebackup(self, data): .format(data['site_name']), backup_path) if data['currsitetype'] in ['html', 'php', 'proxy', 'mysql']: - Log.info(self, "Backing up Webroot \t\t", end='') - EEFileUtils.mvfile(self, ee_site_webroot + '/htdocs', backup_path) - Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") + if (data['pagespeed'] is True or data['old_pagespeed_status'] is True) and not data['wp']: + Log.info(self, "Backing up Webroot \t\t", end='') + EEFileUtils.copyfiles(self, ee_site_webroot + '/htdocs', backup_path + '/htdocs') + Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") + else: + Log.info(self, "Backing up Webroot \t\t", end='') + EEFileUtils.mvfile(self, ee_site_webroot + '/htdocs', backup_path) + Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") configfiles = glob.glob(ee_site_webroot + '/*-config.php') if not configfiles: @@ -653,7 +658,10 @@ def sitebackup(self, data): Log.info(self, "[" + Log.ENDC + "Done" + Log.OKBLUE + "]") # move wp-config.php/ee-config.php to backup if data['currsitetype'] in ['mysql', 'proxy']: - EEFileUtils.mvfile(self, configfiles[0], backup_path) + if (data['pagespeed'] is True or data['old_pagespeed_status'] is True) and not data['wp']: + EEFileUtils.copyfile(self, configfiles[0], backup_path) + else: + EEFileUtils.mvfile(self, configfiles[0], backup_path) else: EEFileUtils.copyfile(self, configfiles[0], backup_path) diff --git a/ee/core/fileutils.py b/ee/core/fileutils.py index 496e1672..b5369050 100644 --- a/ee/core/fileutils.py +++ b/ee/core/fileutils.py @@ -62,11 +62,34 @@ class EEFileUtils(): Log.debug(self, "{0}".format(e)) Log.error(self, "Unable to reomove symbolic link ...\n") - def copyfile(self, src, dest): + def copyfiles(self, src, dest): """ Copies files: src : source path dest : destination path + + Recursively copy an entire directory tree rooted at src. + The destination directory, named by dst, must not already exist; + it will be created as well as missing parent directories. + """ + try: + Log.debug(self, "Copying files, Source:{0}, Dest:{1}" + .format(src, dest)) + shutil.copytree(src, dest) + except shutil.Error as e: + Log.debug(self, "{0}".format(e)) + Log.error(self, 'Unable to copy files from {0} to {1}' + .format(src, dest)) + except IOError as e: + Log.debug(self, "{0}".format(e.strerror)) + Log.error(self, "Unable to copy files from {0} to {1}" + .format(src, dest)) + + def copyfile(self, src, dest): + """ + Copy file: + src : source path + dest : destination path """ try: Log.debug(self, "Copying file, Source:{0}, Dest:{1}" @@ -77,7 +100,7 @@ class EEFileUtils(): Log.error(self, 'Unable to copy file from {0} to {1}' .format(src, dest)) except IOError as e: - Log.debug(self, "{e}".format(e.strerror)) + Log.debug(self, "{0}".format(e.strerror)) Log.error(self, "Unable to copy file from {0} to {1}" .format(src, dest)) diff --git a/ee/core/variables.py b/ee/core/variables.py index 8ffa4c41..9fc00085 100644 --- a/ee/core/variables.py +++ b/ee/core/variables.py @@ -12,11 +12,11 @@ class EEVariables(): """Intialization of core variables""" # EasyEngine version - ee_version = "3.3.11" + ee_version = "3.3.12" # EasyEngine packages versions - ee_wp_cli = "0.20.2" + ee_wp_cli = "0.20.3" ee_adminer = "4.2.1" ee_roundcube = "1.1.3" ee_vimbadmin = "3.0.12" diff --git a/install b/install index 9ea5aa54..1def9d51 100644 --- a/install +++ b/install @@ -48,7 +48,7 @@ fi # Define variables for later use ee_branch=$1 readonly ee_version_old="2.2.3" -readonly ee_version_new="3.3.11" +readonly ee_version_new="3.3.12" readonly ee_log_dir=/var/log/ee/ readonly ee_install_log=/var/log/ee/install.log readonly ee_linux_distro=$(lsb_release -i | awk '{print $3}') diff --git a/setup.py b/setup.py index 932a94b7..ab5ac2cd 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ except Exception as e: os.system("git config --global user.email {0}".format(ee_email)) setup(name='ee', - version='3.3.11', + version='3.3.12', description=long_description, long_description=long_description, classifiers=[],