Commits

Anonymous committed c8e085b

Adding Fabric tasks

  • Participants
  • Parent commits 0bcd70c

Comments (0)

Files changed (1)

+from fabric.api import *
+from glob import glob
+
+@task
+def build():
+    local("mvn package")
+
+@task
+def console():
+    with lcd("target"):
+        local("java -jar api-grinder-1.0-SNAPSHOT.jar")
+
+@task
+def agent():
+    classpath = ""
+    with open("target/classpath", 'r') as f:
+        classpath = f.read()
+    with lcd("target"):
+        local("java -Dgrinder.script=classes/grinder.py -Dgrinder.jvm.classpath=%s -jar api-grinder-1.0-SNAPSHOT.jar agent" % classpath)
+
+@task
+def clean():
+    for logfile in glob("target/*.log"):
+        #print logfile
+        os.remove(logfile)
+
+@task
+def read():
+    logs = sorted(glob("target/*.log"))
+    non_data_logs = [i for i in logs if "-data.log" not in i]
+    for logfile in non_data_logs:
+        with open(logfile, 'r') as f:
+            print logfile
+            print "=" * len(logfile)
+            print
+            print f.read()
+            print
+            print "*" * 80
+            print
+