|
@@ -1,6 +1,7 @@
|
|
import subprocess
|
|
import subprocess
|
|
import sys
|
|
import sys
|
|
import setup_util
|
|
import setup_util
|
|
|
|
+import os
|
|
from os.path import expanduser
|
|
from os.path import expanduser
|
|
|
|
|
|
home = expanduser("~")
|
|
home = expanduser("~")
|
|
@@ -9,20 +10,24 @@ def start(args):
|
|
setup_util.replace_text("phreeze/index.php", "localhost:3306", "" + args.database_host + ":3306")
|
|
setup_util.replace_text("phreeze/index.php", "localhost:3306", "" + args.database_host + ":3306")
|
|
setup_util.replace_text("phreeze/deploy/phreeze", "\".*\/FrameworkBenchmarks", "\"" + home + "/FrameworkBenchmarks")
|
|
setup_util.replace_text("phreeze/deploy/phreeze", "\".*\/FrameworkBenchmarks", "\"" + home + "/FrameworkBenchmarks")
|
|
setup_util.replace_text("phreeze/deploy/phreeze", "Directory .*\/FrameworkBenchmarks", "Directory " + home + "/FrameworkBenchmarks")
|
|
setup_util.replace_text("phreeze/deploy/phreeze", "Directory .*\/FrameworkBenchmarks", "Directory " + home + "/FrameworkBenchmarks")
|
|
-
|
|
|
|
|
|
+ setup_util.replace_text("phreeze/deploy/nginx.conf", "root .*\/FrameworkBenchmarks", "root " + home + "/FrameworkBenchmarks")
|
|
|
|
+
|
|
try:
|
|
try:
|
|
- subprocess.check_call("sudo cp phreeze /etc/apache2/sites-available/", shell=True)
|
|
|
|
- subprocess.check_call("sudo a2ensite phreeze", shell=True)
|
|
|
|
- subprocess.check_call("sudo chown -R www-data:www-data phreeze", shell=True)
|
|
|
|
- subprocess.check_call("sudo /etc/init.d/apache2 start", shell=True)
|
|
|
|
|
|
+ #subprocess.check_call("sudo cp php/deploy/phreeze /etc/apache2/sites-available/", shell=True)
|
|
|
|
+ #subprocess.check_call("sudo a2ensite php", shell=True)
|
|
|
|
+ #subprocess.check_call("sudo chown -R www-data:www-data php", shell=True)
|
|
|
|
+ #subprocess.check_call("sudo /etc/init.d/apache2 start", shell=True)
|
|
|
|
+ subprocess.check_call("sudo php-fpm --fpm-config config/php-fpm.conf -g " + home + "/FrameworkBenchmarks/phreeze/deploy/php-fpm.pid", shell=True)
|
|
|
|
+ subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/phreeze/deploy/nginx.conf", shell=True)
|
|
|
|
+
|
|
return 0
|
|
return 0
|
|
except subprocess.CalledProcessError:
|
|
except subprocess.CalledProcessError:
|
|
return 1
|
|
return 1
|
|
def stop():
|
|
def stop():
|
|
try:
|
|
try:
|
|
- subprocess.check_call("sudo a2dissite phreeze", shell=True)
|
|
|
|
- subprocess.check_call("sudo /etc/init.d/apache2 stop", shell=True)
|
|
|
|
- subprocess.check_call("sudo chown -R $USER:$USER phreeze", shell=True)
|
|
|
|
|
|
+ subprocess.call("sudo /usr/local/nginx/sbin/nginx -s stop", shell=True)
|
|
|
|
+ subprocess.call("sudo kill -QUIT $( cat phreeze/deploy/php-fpm.pid )", shell=True)
|
|
|
|
+
|
|
return 0
|
|
return 0
|
|
except subprocess.CalledProcessError:
|
|
except subprocess.CalledProcessError:
|
|
return 1
|
|
return 1
|