From a9a2825a72bbd98f1e8bcaa3c230debe29637116 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 17 Jun 2019 11:39:55 +0200 Subject: [PATCH 1/4] Fix typo, do not reinstall php if wo release >=3.9.5 --- install | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/install b/install index 1c73fdc..17b4e1e 100755 --- a/install +++ b/install @@ -254,7 +254,7 @@ wo_sync_db() { wo_site_current_type=$(grep "common/" /etc/nginx/sites-available/$site | awk -F "/" '{print $2}') - if [ "$(echo $wo_site_current_type | grep php)" ]; then + if [ -n "$(echo $wo_site_current_type | grep php)" ]; then if [ "$(echo $wo_site_current_type | grep php7)" ]; then wo_php_version="7.0" else @@ -488,17 +488,19 @@ wo_upgrade_nginx() { if [ -d /etc/nginx ]; then rm -rf /etc/nginx fi - # remove previous php-fpm pool configuration - if [ -n "$CHECK_PHP72" ]; then - apt-get remove php7.2-fpm -y -qq --purge - rm -f /etc/php/7.2/fpm/pool.d/{www.conf,www-two.conf,debug.conf} - fi - if [ -n "$CHECK_PHP73" ]; then - WO_STACK_INSTALL_ARGS="--php73" - apt-get remove php7.3-fpm -y -qq --purge - rm -f /etc/php/7.3/fpm/pool.d/{www.conf,www-two.conf,debug.conf} - else - WO WO_STACK_INSTALL_ARGS="" + if [ -z "$(/usr/local/bin/wo -v | grep 3.9.5)" ]; then + # remove previous php-fpm pool configuration + if [ -n "$CHECK_PHP72" ]; then + apt-get remove php7.2-fpm -y -qq --purge + rm -f /etc/php/7.2/fpm/pool.d/{www.conf,www-two.conf,debug.conf} + fi + if [ -n "$CHECK_PHP73" ]; then + WO_STACK_INSTALL_ARGS="--php73" + apt-get remove php7.3-fpm -y -qq --purge + rm -f /etc/php/7.3/fpm/pool.d/{www.conf,www-two.conf,debug.conf} + else + WO_STACK_INSTALL_ARGS="" + fi fi /usr/local/bin/wo stack install --nginx --php "$WO_STACK_INSTALL_ARGS" echo "$wo_version_new" > /etc/nginx/common/release From 628a0c4bca60c98b8d32115ee0ce1aa3e25d1db8 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 17 Jun 2019 11:44:46 +0200 Subject: [PATCH 2/4] Add settings for testing with travis --- wo/cli/plugins/update.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wo/cli/plugins/update.py b/wo/cli/plugins/update.py index 07214e7..53e741f 100644 --- a/wo/cli/plugins/update.py +++ b/wo/cli/plugins/update.py @@ -21,6 +21,9 @@ class WOUpdateController(CementBaseController): arguments = [ (['--force'], dict(help='Force WordOps update', action='store_true')), + (['--travis'], + dict(help='Argument used only for WordOps development', + action='store_true')), ] usage = "wo update [options]" @@ -28,7 +31,7 @@ class WOUpdateController(CementBaseController): def default(self): filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S") WODownload.download(self, [["https://raw.githubusercontent.com/" - "WordOps/WordOps/master/install", + "WordOps/WordOps/updating-configuration/install", "/tmp/{0}".format(filename), "update script"]]) if self.app.pargs.force: @@ -45,6 +48,10 @@ class WOUpdateController(CementBaseController): except OSError as e: Log.debug(self, str(e)) Log.error(self, "WordOps update failed !") + if self.app.pargs.travis: + try: + Log.info(self, "updating WordOps, please wait...") + os.system("bash /tmp/{0} --travis --force".format(filename)) def load(app): From 8140394b5a65773a6273065b32438e8f1c8efe84 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 17 Jun 2019 11:46:29 +0200 Subject: [PATCH 3/4] Update travis --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a0d2dbf..82851da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,5 +55,5 @@ script: - sudo wo info || sudo tail -n50 /var/log/wo/wordops.log - sudo tree -L 2 /etc/nginx - sudo cat /var/www/wpredis.net/wp-config.php - - echo "127.0.0.1 wpredis.net" | sudo tee -a /etc/hosts - - curl -sL http://wpredis.net/robots.txt + - sudo wo update --travis || sudo tail -n50 /var/log/wo/wordops.log + - sudo wo stack status \ No newline at end of file From dbffa22412ee6aff1a29ca421389dfbcf7f541a8 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 17 Jun 2019 11:56:33 +0200 Subject: [PATCH 4/4] Fix wo update --- wo/cli/plugins/update.py | 41 ++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/wo/cli/plugins/update.py b/wo/cli/plugins/update.py index 53e741f..d73df7b 100644 --- a/wo/cli/plugins/update.py +++ b/wo/cli/plugins/update.py @@ -30,28 +30,37 @@ class WOUpdateController(CementBaseController): @expose(hide=True) def default(self): filename = "woupdate" + time.strftime("%Y%m%d-%H%M%S") - WODownload.download(self, [["https://raw.githubusercontent.com/" - "WordOps/WordOps/updating-configuration/install", - "/tmp/{0}".format(filename), - "update script"]]) - if self.app.pargs.force: + + if self.app.pargs.travis: + WODownload.download(self, [["https://raw.githubusercontent.com/" + "WordOps/WordOps/updating-configuration/install", + "/tmp/{0}".format(filename), + "update script"]]) try: Log.info(self, "updating WordOps, please wait...") - os.system("bash /tmp/{0} --force".format(filename)) + os.system("bash /tmp/{0} --travis --force".format(filename)) except OSError as e: Log.debug(self, str(e)) Log.error(self, "WordOps update failed !") else: - try: - Log.info(self, "updating WordOps, please wait...") - os.system("bash /tmp/{0}".format(filename)) - except OSError as e: - Log.debug(self, str(e)) - Log.error(self, "WordOps update failed !") - if self.app.pargs.travis: - try: - Log.info(self, "updating WordOps, please wait...") - os.system("bash /tmp/{0} --travis --force".format(filename)) + WODownload.download(self, [["https://raw.githubusercontent.com/" + "WordOps/WordOps/master/install", + "/tmp/{0}".format(filename), + "update script"]]) + if self.app.pargs.force: + try: + Log.info(self, "updating WordOps, please wait...") + os.system("bash /tmp/{0} --force".format(filename)) + except OSError as e: + Log.debug(self, str(e)) + Log.error(self, "WordOps update failed !") + else: + try: + Log.info(self, "updating WordOps, please wait...") + os.system("bash /tmp/{0}".format(filename)) + except OSError as e: + Log.debug(self, str(e)) + Log.error(self, "WordOps update failed !") def load(app):