From a20e610aff4b96315f3f6eeeb344d97c5d6e0c27 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sun, 3 Mar 2019 14:54:12 +0100 Subject: [PATCH] testing php73 stack * add new travis test * remove temporarily few travis test to speed up the build * --experimental args isn't required anymore --- .travis.yml | 43 +++++++++++++----------------- wo/cli/plugins/site.py | 4 +-- wo/cli/plugins/site_functions.py | 18 ++++++------- wo/cli/plugins/stack.py | 16 +++++------ wo/cli/templates/wpcommon.mustache | 2 +- 5 files changed, 38 insertions(+), 45 deletions(-) diff --git a/.travis.yml b/.travis.yml index 62880fc..29431b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_script: - sudo rm -rf /etc/mysql/ - sudo bash -c 'echo example.com > /etc/hostname' - sudo apt-get -qq purge mysql* graphviz* - - sudo apt-get -qq autoremove + - sudo apt-get -qq autoremove --purge - sudo apt-get update script: @@ -20,7 +20,7 @@ script: - unset LANG - sudo bash -c 'echo -e "[user]\n\tname = abc\n\temail = root@localhost.com" > /home/travis/.gitconfig' - sudo echo "Travis Banch = $TRAVIS_BRANCH" - - sudo apt-get install -y --force-yes git python3-setuptools python3-dev python3-apt + - sudo apt-get install -y --force-yes git python3-setuptools python3-dev python3-apt ccze - sudo bash install $TRAVIS_BRANCH - sudo wo --help - sudo wo stack install || sudo tail -n50 /var/log/wo/wordops.log @@ -30,31 +30,24 @@ script: - sudo wo site create html.net --html || sudo tail -n50 /var/log/wo/wordops.log - sudo wo site create php.com --php || sudo tail -n50 /var/log/wo/wordops.log - sudo wo site create mysql.com --mysql || sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site1.com --wp || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create mysql.com --mysql --php73 || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wp1.com --wp || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wp1.com --wp --php73 ```|| sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site2.net --wp --wpsc || sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site4.com --wpfc || sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site4.net --wp --wpfc || sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site4.org --wpfc --wp || sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site5.com --wpsubdir || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wpsc1.net --wp --wpsc || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wpfc1.com --wpfc || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wpfc2.net --wp --wpfc || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wpfc3.org --wpfc --wp || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wpsubdir1.com --wpsubdir || sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site6.com --wpsubdir --wpsc || sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site8.com --wpsubdir --wpfc || sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site8.net --wpfc --wpsubdir || sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site9.com --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wpsubdirwpsc1.com --wpsubdir --wpsc || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wpsubdirwpsc2.com --wpsubdir --wpfc || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wpsubdirwpfc3.net --wpfc --wpsubdir || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wpsubdomain1.com --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site10.org --wpsubdomain --wpsc || sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site12.org --wpsubdomain --wpfc || sudo tail -n50 /var/log/wo/wordops.log - - sudo wo site create site12.in --wpfc --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log - - - yes | sudo wo site create site.hhvm.pagespeed2.com --wpsc --hhvm || sudo tail -n50 /var/log/wo/wordops.log - - yes | sudo wo site create site.hhvm.pagespeed4.com --wpfc --hhvm || sudo tail -n50 /var/log/wo/wordops.log - - yes | sudo wo site create site.hhvm.pagespeed5.com --wpsubdir --hhvm || sudo tail -n50 /var/log/wo/wordops.log - - yes | sudo wo site create site.hhvm.pagespeed6.com --wpsubdir --wpsc --hhvm || sudo tail -n50 /var/log/wo/wordops.log - - yes | sudo wo site create site.hhvm.pagespeed8.com --wpsubdir --wpfc --hhvm || sudo tail -n50 /var/log/wo/wordops.log - - yes | sudo wo site create site.hhvm.pagespeed9.com --wpsubdomain --hhvm || sudo tail -n50 /var/log/wo/wordops.log - - yes | sudo wo site create site.hhvm.pagespeed10.org --wpsubdomain --wpsc --hhvm || sudo tail -n50 /var/log/wo/wordops.log - - yes | sudo wo site create site.hhvm.pagespeed12.in --wpfc --wpsubdomain --hhvm || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wpsubdomainwpsc.org --wpsubdomain --wpsc || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wpsubdomainwpfc.org --wpsubdomain --wpfc || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo site create wpsubdomainwpfc2.in --wpfc --wpsubdomain || sudo tail -n50 /var/log/wo/wordops.log - sudo wo site create site1.localtest.me --php --mysql || sudo tail -n50 /var/log/wo/wordops.log - sudo wo site create site2.localtest.me --mysql --html || sudo tail -n50 /var/log/wo/wordops.log @@ -101,4 +94,4 @@ script: - sudo ls /var/www/ - sudo wp --allow-root --info - - sudo bash -c 'cat /var/log/wo/wordops.log' + - sudo bash -c 'cat /var/log/wo/wordops.log | ccze -A' diff --git a/wo/cli/plugins/site.py b/wo/cli/plugins/site.py index e9cb632..c5b010c 100644 --- a/wo/cli/plugins/site.py +++ b/wo/cli/plugins/site.py @@ -455,7 +455,7 @@ class WOSiteCreateController(CementBaseController): if data and self.app.pargs.php73: if (self.app.pargs.experimental): - Log.info(self, "Do you wish to install PHP 7.2 now for {0}?".format(wo_domain)) + Log.info(self, "Do you wish to install PHP 7.3 now for {0}?".format(wo_domain)) # Check prompt check_prompt = input("Type \"y\" to continue [n]:") @@ -899,7 +899,7 @@ class WOSiteUpdateController(CementBaseController): check_ssl = check_site.is_ssl check_php_version = check_site.php_version - if check_php_version == "7.2": + if check_php_version == "7.3": old_php73 = True else: old_php73 = False diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 7d128be..4137fb9 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -711,18 +711,18 @@ def site_package_check(self, stype): if self.app.pargs.php and self.app.pargs.php73: Log.error(self,"Error: two different PHP versions cannot be combined within the same WordOps site") - if not self.app.pargs.php73 and stype in ['php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']: - Log.debug(self, "Setting apt_packages variable for PHP") - apt_packages = apt_packages + WOVariables.wo_php73 + WOVariables.wo_php_extra + if not self.app.pargs.php and stype in ['php', 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']: + Log.debug(self, "Setting apt_packages variable for PHP 7.2") + apt_packages = apt_packages + WOVariables.wo_php + WOVariables.wo_php_extra - if self.app.pargs.php73 and stype in [ 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']: + if self.app.pargs.php and stype in [ 'mysql', 'wp', 'wpsubdir', 'wpsubdomain']: if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'): - Log.debug(self, "Setting apt_packages variable for PHP 7.3") + Log.debug(self, "Setting apt_packages variable for PHP 7.2") if not WOAptGet.is_installed(self, 'php7.3-fpm'): - apt_packages = apt_packages + WOVariables.wo_php73 + WOVariables.wo_php_extra + apt_packages = apt_packages + WOVariables.wo_php + WOVariables.wo_php_extra else: - Log.debug(self, "Setting apt_packages variable for PHP 7.3") - if not WOAptGet.is_installed(self, 'php7.3-fpm'): + Log.debug(self, "Setting apt_packages variable for PHP 7.2") + if not WOAptGet.is_installed(self, 'php7.2-fpm'): apt_packages = apt_packages + WOVariables.wo_php73 if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: @@ -832,7 +832,7 @@ def site_package_check(self, stype): if self.app.pargs.php73: if (WOVariables.wo_platform_codename == 'wheezy' or WOVariables.wo_platform_codename == 'precise'): - Log.error(self,"PHP 7.0 is not supported in your Platform") + Log.error(self,"PHP 7.3 is not supported in your Platform") Log.debug(self, "Setting apt_packages variable for PHP 7.3") if not WOAptGet.is_installed(self, 'php7.3-fpm'): diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index 63cf56c..2b6c167 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -155,12 +155,12 @@ class WOStackController(CementBaseController): if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'): if set(WOVariables.wo_php73).issubset(set(apt_packages)): - Log.info(self, "Adding repository for PHP, please wait...") + Log.info(self, "Adding repository for PHP 7.3, please wait...") Log.debug(self, 'Adding ppa for PHP') WORepo.add(self, ppa=WOVariables.wo_php_repo) else: if set(WOVariables.wo_php).issubset(set(apt_packages)): - Log.info(self, "Adding repository for PHP, please wait...") + Log.info(self, "Adding repository for PHP 7.2, please wait...") # Add repository for php if WOVariables.wo_platform_distro == 'debian': if WOVariables.wo_platform_codename != 'jessie': @@ -174,7 +174,7 @@ class WOStackController(CementBaseController): if WOVariables.wo_platform_codename == 'jessie': if set(WOVariables.wo_php73).issubset(set(apt_packages)): - Log.debug(self, 'Adding repo_url of php 7.0 for debian') + Log.debug(self, 'Adding repo_url of php 7.3 for debian') WORepo.add(self, repo_url=WOVariables.wo_php_repo) Log.debug(self, 'Adding Dotdeb/php GPG key') WORepo.add_key(self, '89DF5277') @@ -1397,15 +1397,15 @@ class WOStackController(CementBaseController): Log.debug(self, "Nginx Stable already installed") if self.app.pargs.php: - Log.debug(self, "Setting apt_packages variable for PHP") + Log.debug(self, "Setting apt_packages variable for PHP 7.2") if not (WOAptGet.is_installed(self, 'php5-fpm') or WOAptGet.is_installed(self, 'php7.2-fpm')): if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'): apt_packages = apt_packages + WOVariables.wo_php + WOVariables.wo_php_extra else: apt_packages = apt_packages + WOVariables.wo_php else: - Log.debug(self, "PHP already installed") - Log.info(self, "PHP already installed") + Log.debug(self, "PHP 7.2 already installed") + Log.info(self, "PHP 7.2 already installed") # PHP 7.3 for Debian (jessie+) if self.app.pargs.php73 and WOVariables.wo_platform_distro == 'debian': @@ -1434,9 +1434,9 @@ class WOStackController(CementBaseController): Log.info(self, "PHP 7.3 already installed") else: Log.debug( - self, "Unfortunately PHP 7.3 is not available for your Ubuntu or Debian version.") + self, "Unfortunately PHP 7.3 is not available for your Ubuntu or Debian version.") Log.info( - self, "Unfortunately PHP 7.3 is not available for your Ubuntu or Debian version.") + self, "Unfortunately PHP 7.3 is not available for your Ubuntu or Debian version.") if self.app.pargs.hhvm: Log.debug(self, "Setting apt packages variable for HHVM") diff --git a/wo/cli/templates/wpcommon.mustache b/wo/cli/templates/wpcommon.mustache index 1444c22..dd4e641 100644 --- a/wo/cli/templates/wpcommon.mustache +++ b/wo/cli/templates/wpcommon.mustache @@ -25,7 +25,7 @@ location /wp-content/uploads { try_files $uri$webp_suffix $uri =404; } location ~ \.php$ { -#Prevent Direct Access Of PHP Files From Web Browsers + #Prevent Direct Access Of PHP Files From Web Browsers deny all; } }