Raphael Javaux hace 12 años
padre
commit
d87ee5a523
Se han modificado 2 ficheros con 16 adiciones y 2 borrados
  1. 11 0
      installer.py
  2. 5 2
      yesod/setup.py

+ 11 - 0
installer.py

@@ -86,6 +86,12 @@ class Installer:
 
     self.__run_command("sudo apt-get install php5 php5-mysql", True)
 
+    #
+    # Haskell
+    #
+
+    self.__run_command("sudo apt-get install ghc cabal-install", True)
+
     #######################################
     # Webservers
     #######################################
@@ -201,6 +207,11 @@ class Installer:
     ##############################
     self.__run_command("go/bin/go get github.com/hoisie/web")
 
+    ##############################
+    # Yesod
+    ##############################
+    self.__run_command("cabal install yesod")
+
     ##############################################################
     #
     # System Tools

+ 5 - 2
yesod/setup.py

@@ -6,14 +6,17 @@ import os
 
 def start(args):
   setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'")
+  
+  subprocess.check_call("cabal configure", shell=True, cwd="yesod/src")
+  subprocess.check_call("cabal build", shell=True, cwd="yesod/src")
 
-  subprocess.Popen("gunicorn hello.wsgi:application -b 0.0.0.0:8080 -w " + str((args.max_threads * 2)) + " --log-level=critical", shell=True, cwd="django/hello")
+  subprocess.Popen("./dist/yesod_bench Production +RTS -N" + str(args.max_threads ) + " > /dev/null", shell=True, cwd="yesod/src")
   return 0
 def stop():
   p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
   out, err = p.communicate()
   for line in out.splitlines():
-    if 'gunicorn' in line:
+    if 'yesod_bench' in line:
       try:
         pid = int(line.split(None, 2)[1])
         os.kill(pid, 9)