瀏覽代碼

Fixed up lein and updated http-kit

msmith-techempower 11 年之前
父節點
當前提交
c0e91d6342

+ 1 - 3
frameworks/Clojure/compojure/bash_profile.sh

@@ -2,6 +2,4 @@
 
 export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 export RESIN_HOME=${IROOT}/resin-4.0.41
-export LEIN_HOME=$IROOT/bin
-
-export PATH="$JAVA_HOME/bin:$LEIN_HOME:$PATH"
+export LEIN_HOME=$IROOT/lein

+ 3 - 3
frameworks/Clojure/compojure/setup.sh

@@ -1,13 +1,13 @@
 #!/bin/bash
 
 # Path vars must be set here
-export PATH="$JAVA_HOME/bin:$LEIN_HOME:$PATH"
+export PATH="$JAVA_HOME/bin:$PATH"
 
 sed -i 's|:subname "//.*:3306|:subname "//'"${DBHOST}"':3306|g' hello/src/hello/handler.clj
 
 cd hello
-$IROOT/bin/lein clean
-$IROOT/bin/lein ring uberwar
+$LEIN_HOME/bin/lein clean
+$LEIN_HOME/bin/lein ring uberwar
 rm -rf $RESIN_HOME/webapps/*
 cp target/hello-compojure-standalone.war $RESIN_HOME/webapps/compojure.war
 $RESIN_HOME/bin/resinctl start

+ 1 - 3
frameworks/Clojure/http-kit/bash_profile.sh

@@ -2,6 +2,4 @@
 
 export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
 
-export LEIN_HOME=$IROOT/bin
-
-export PATH="$JAVA_HOME/bin:$LEIN_HOME:$PATH"
+export LEIN_HOME=$IROOT/lein

+ 0 - 28
frameworks/Clojure/http-kit/setup.py

@@ -1,28 +0,0 @@
-
-import subprocess
-import sys
-import setup_util
-
-def start(args, logfile, errfile):
-
-  try:
-    subprocess.check_call("lein clean", shell=True, cwd="http-kit/hello", stderr=errfile, stdout=logfile)
-    subprocess.check_call("lein deps", shell=True, cwd="http-kit/hello", stderr=errfile, stdout=logfile)
-    subprocess.check_call("rm -rf target", shell=True, cwd="http-kit/hello")
-    # pack all dependencies into a single jar: target/http-kit-standalone.jar
-    subprocess.check_call("lein uberjar", shell=True, cwd="http-kit/hello", stderr=errfile, stdout=logfile)
-    # -server is much faster
-    # 'lein run' passes '-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1' which make it starts fast, but runs slow
-    command = "java -server -jar target/http-kit-standalone.jar --db-host " + args.database_host
-    subprocess.Popen(command, shell=True, cwd="http-kit/hello", stderr=errfile, stdout=logfile)
-    return 0
-  except subprocess.CalledProcessError:
-    return 1
-
-def stop(logfile, errfile):
-  try:
-    # listen on 8080
-    subprocess.check_call("lsof -t -sTCP:LISTEN -i:8080 | xargs kill", shell=True, stderr=errfile, stdout=logfile)
-    return 0
-  except subprocess.CalledProcessError:
-    return 1

+ 11 - 0
frameworks/Clojure/http-kit/setup.sh

@@ -0,0 +1,11 @@
+#!/bin/bash
+
+cd hello
+$LEIN_HOME/bin/lein clean
+$LEIN_HOME/bin/lein deps
+rm -rf target
+# pack all dependencies into a single jar: target/http-kit-standalone.jar
+$LEIN_HOME/bin/lein uberjar
+# -server is much faster
+# 'lein run' passes '-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1' which make it starts fast, but runs slow
+$JAVA_HOME/bin/java -server -jar target/http-kit-standalone.jar --db-host ${DBHOST}