From 06dc923213428444fc47b391d7a322eeaac0f0c0 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 20 Mar 2015 15:55:30 +0530 Subject: [PATCH] Add HHVM/Nginx configs to updated server --- ee/cli/plugins/stack.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/ee/cli/plugins/stack.py b/ee/cli/plugins/stack.py index c8e52695..689d487a 100644 --- a/ee/cli/plugins/stack.py +++ b/ee/cli/plugins/stack.py @@ -586,6 +586,41 @@ class EEStackController(CementBaseController): EEService.restart_service(self, 'hhvm') EEService.reload_service(self, 'nginx') + if os.path.isdir("/etc/nginx") and (not + os.path.isfile("/etc/nginx/common/php-hhvm.conf")): + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/php-hhvm.conf') + ee_nginx = open('/etc/nginx/common/php-hhvm.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'php-hhvm.mustache', + out=ee_nginx) + ee_nginx.close() + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/w3tc-hhvm.conf') + ee_nginx = open('/etc/nginx/common/w3tc-hhvm.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'w3tc-hhvm.mustache', + out=ee_nginx) + ee_nginx.close() + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/wpfc-hhvm.conf') + ee_nginx = open('/etc/nginx/common/wpfc-hhvm.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'wpfc-hhvm.mustache', + out=ee_nginx) + ee_nginx.close() + + Log.debug(self, 'Writting the nginx configuration to ' + 'file /etc/nginx/common/wpsc-hhvm.conf') + ee_nginx = open('/etc/nginx/common/wpsc-hhvm.conf', + encoding='utf-8', mode='w') + self.app.render((data), 'wpsc-hhvm.mustache', + out=ee_nginx) + ee_nginx.close() + if set(EEVariables.ee_mysql).issubset(set(apt_packages)): # TODO: Currently we are using, we need to remove it in future # config = configparser.ConfigParser()