Browse Source

Updated the Go frameworks

msmith-techempower 10 years ago
parent
commit
12f02f74b3

+ 0 - 3
frameworks/Go/beego/bash_profile.sh

@@ -1,7 +1,4 @@
 # Set the root of our go installation
 export GOROOT=${IROOT}/go
 
-# Where to find the go executable
-export PATH="$GOROOT/bin:$PATH"
-
 export GOPATH=${TROOT}

+ 0 - 25
frameworks/Go/beego/setup.py

@@ -1,25 +0,0 @@
-
-import subprocess
-import sys
-import os
-
-def start(args, logfile, errfile):
-  if os.name == 'nt':
-    subprocess.call("set GOPATH=C:\\FrameworkBenchmarks\\beego&&go get ./...", shell=True, cwd="beego", stderr=errfile, stdout=logfile)
-    subprocess.Popen("setup.bat", shell=True, cwd="beego", stderr=errfile, stdout=logfile)
-    return 0
-  subprocess.call("go get ./...", shell=True, cwd="beego", stderr=errfile, stdout=logfile)
-  subprocess.Popen("go run src/hello/hello.go".rsplit(" "), cwd="beego", stderr=errfile, stdout=logfile)
-  return 0
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    subprocess.call("taskkill /f /im go.exe > NUL", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.call("taskkill /f /im hello.exe > NUL", shell=True, stderr=errfile, stdout=logfile)
-    return 0
-  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-  out, err = p.communicate()
-  for line in out.splitlines():
-    if 'hello' in line:
-      pid = int(line.split(None, 2)[1])
-      os.kill(pid, 15)
-  return 0

+ 7 - 0
frameworks/Go/beego/setup.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# Where to find the go executable
+export PATH="$GOROOT/bin:$PATH"
+
+go get ./...
+go run src/hello/hello.go &

+ 0 - 3
frameworks/Go/gin/bash_profile.sh

@@ -1,7 +1,4 @@
 # Set the root of our go installation
 export GOROOT=${IROOT}/go
 
-# Where to find the go executable
-export PATH="$GOROOT/bin:$PATH"
-
 export GOPATH=${TROOT}

+ 0 - 17
frameworks/Go/gin/setup.py

@@ -1,17 +0,0 @@
-import subprocess
-import os
-
-
-def start(args, logfile, errfile):
-    subprocess.Popen("go run hello.go".rsplit(" "), cwd="gin", stderr=errfile, stdout=logfile)
-    return 0
-
-
-def stop(logfile, errfile):
-    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-    out, err = p.communicate()
-    for line in out.splitlines():
-        if 'hello' in line:
-            pid = int(line.split(None, 2)[1])
-            os.kill(pid, 15)
-    return 0

+ 8 - 0
frameworks/Go/gin/setup.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Where to find the go executable
+export PATH="$GOROOT/bin:$PATH"
+
+go get ./...
+
+go run hello.go &

+ 0 - 3
frameworks/Go/go/bash_profile.sh

@@ -1,7 +1,4 @@
 # Set the root of our go installation
 export GOROOT=${IROOT}/go
 
-# Where to find the go executable
-export PATH="$GOROOT/bin:$PATH"
-
 export GOPATH=${TROOT}

+ 0 - 29
frameworks/Go/go/setup.py

@@ -1,29 +0,0 @@
-import subprocess
-import sys
-import os
-import setup_util
-
-def start(args, logfile, errfile):
-  setup_util.replace_text("go/src/hello/hello.go", "tcp\(.*:3306\)", "tcp(" + args.database_host + ":3306)")
-  if os.name == 'nt':
-    #subprocess.call("rmdir /s /q pkg\\windows_amd64", shell=True, cwd="go")
-    #subprocess.call("rmdir /s /q src\\github.com", shell=True, cwd="go")
-    #subprocess.call("del /s /q /f bin\\hello.exe", shell=True, cwd="go")
-    subprocess.call("set GOPATH=C:\\FrameworkBenchmarks\\go&& go get ./...", shell=True, cwd="go", stderr=errfile, stdout=logfile)
-    subprocess.Popen("setup.bat", shell=True, cwd="go", stderr=errfile, stdout=logfile) 
-    return 0
-  subprocess.call("go get ./...", shell=True, cwd="go", stderr=errfile, stdout=logfile) 
-  subprocess.Popen("go run src/hello/hello.go".rsplit(" "), cwd="go", stderr=errfile, stdout=logfile)
-  return 0
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    subprocess.call("taskkill /f /im go.exe > NUL", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.call("taskkill /f /im hello.exe > NUL", shell=True, stderr=errfile, stdout=logfile)
-    return 0
-  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-  out, err = p.communicate()
-  for line in out.splitlines():
-    if 'hello' in line:
-      pid = int(line.split(None, 2)[1])
-      os.kill(pid, 15)
-  return 0

+ 8 - 0
frameworks/Go/go/setup.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Where to find the go executable
+export PATH="$GOROOT/bin:$PATH"
+
+go get ./...
+
+go run src/hello/hello.go &

+ 0 - 3
frameworks/Go/gorail/bash_profile.sh

@@ -1,7 +1,4 @@
 # Set the root of our go installation
 export GOROOT=${IROOT}/go
 
-# Where to find the go executable
-export PATH="$GOROOT/bin:$PATH"
-
 export GOPATH=${TROOT}

+ 0 - 30
frameworks/Go/gorail/setup.py

@@ -1,30 +0,0 @@
-import subprocess
-import sys
-import os
-import setup_util
-
-def start(args, logfile, errfile):
-  setup_util.replace_text("go/src/hello/hello.go", "tcp\(.*:3306\)", "tcp(" + args.database_host + ":3306)")
-  if os.name == 'nt':
-    #subprocess.call("rmdir /s /q pkg\\windows_amd64", shell=True, cwd="go")
-    #subprocess.call("rmdir /s /q src\\github.com", shell=True, cwd="go")
-    #subprocess.call("del /s /q /f bin\\hello.exe", shell=True, cwd="go")
-    subprocess.call("set GOPATH=C:\\FrameworkBenchmarks\\gorail&& go get ./...", shell=True, cwd="go", stderr=errfile, stdout=logfile)
-    subprocess.Popen("setup.bat", shell=True, cwd="go", stderr=errfile, stdout=logfile) 
-    return 0
-  subprocess.call("go get -u github.com/gorail/core", shell=True, cwd="gorail", stderr=errfile, stdout=logfile)
-  subprocess.call("go get ./...", shell=True, cwd="go", stderr=errfile, stdout=logfile) 
-  subprocess.Popen("go run src/hello/hello.go".rsplit(" "), cwd="go", stderr=errfile, stdout=logfile)
-  return 0
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    subprocess.call("taskkill /f /im go.exe > NUL", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.call("taskkill /f /im hello.exe > NUL", shell=True, stderr=errfile, stdout=logfile)
-    return 0
-  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-  out, err = p.communicate()
-  for line in out.splitlines():
-    if 'hello' in line:
-      pid = int(line.split(None, 2)[1])
-      os.kill(pid, 15)
-  return 0

+ 8 - 0
frameworks/Go/gorail/setup.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Where to find the go executable
+export PATH="$GOROOT/bin:$PATH"
+
+go get ./...
+
+go run src/hello/hello.go &

+ 0 - 3
frameworks/Go/revel-qbs/bash_profile.sh

@@ -1,7 +1,4 @@
 # Set the root of our go installation
 export GOROOT=${IROOT}/go
 
-# Where to find the go executable
-export PATH="$GOROOT/bin:$PATH"
-
 export GOPATH=${TROOT}

+ 0 - 34
frameworks/Go/revel-qbs/setup.py

@@ -1,34 +0,0 @@
-import subprocess
-import sys
-import os
-import setup_util
-import time
-
-CWD = 'revel-qbs'
-
-def start(args, logfile, errfile):
-  setup_util.replace_text(CWD + "/src/benchmark/conf/app.conf", "tcp\(.*:3306\)", "tcp(" + args.database_host + ":3306)")
-  if os.name == 'nt':
-    env = os.environ.copy()
-    env["GOPATH"] = "C:\\FrameworkBenchmarks\\" + CWD
-    subprocess.call("go get -u github.com/robfig/revel/revel github.com/coocood/qbs", shell=True, cwd=CWD, env=env, stderr=errfile, stdout=logfile)
-    subprocess.call(r"go build -o bin\revel.exe github.com/robfig/revel/revel", shell=True, cwd=CWD, env=env, stderr=errfile, stdout=logfile)
-    subprocess.Popen(r"bin\revel.exe run benchmark prod".rsplit(" "), shell=True, cwd=CWD, env=env, stderr=errfile, stdout=logfile)
-    return 0
-  subprocess.call("go get -u github.com/robfig/revel/revel github.com/coocood/qbs", shell=True, cwd=CWD, stderr=errfile, stdout=logfile)
-  subprocess.call("go build -o bin/revel github.com/robfig/revel/revel", shell=True, cwd=CWD, stderr=errfile, stdout=logfile)
-  subprocess.Popen("bin/revel run benchmark prod".rsplit(" "), cwd=CWD, stderr=errfile, stdout=logfile)
-  return 0
-
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    subprocess.call("taskkill /f /im benchmark.exe > NUL", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.call("taskkill /f /im revel.exe > NUL", shell=True, stderr=errfile, stdout=logfile)
-    return 0
-  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-  out, err = p.communicate()
-  for line in out.splitlines():
-    if 'revel' in line and 'run-tests' not in line and 'run-ci' not in line:
-      pid = int(line.split(None, 2)[1])
-      os.kill(pid, 15)
-  return 0

+ 8 - 0
frameworks/Go/revel-qbs/setup.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Where to find the go executable
+export PATH="$GOROOT/bin:$PATH"
+
+go get -u github.com/robfig/revel/revel github.com/coocood/qbs
+go build -o bin/revel github.com/robfig/revel/revel
+bin/revel run benchmark prod &

+ 0 - 3
frameworks/Go/revel/bash_profile.sh

@@ -1,7 +1,4 @@
 # Set the root of our go installation
 export GOROOT=${IROOT}/go
 
-# Where to find the go executable
-export PATH="$GOROOT/bin:$PATH"
-
 export GOPATH=${TROOT}

+ 0 - 34
frameworks/Go/revel/setup.py

@@ -1,34 +0,0 @@
-import subprocess
-import sys
-import os
-import setup_util
-import time
-
-
-
-def start(args, logfile, errfile):
-  setup_util.replace_text("revel/src/benchmark/conf/app.conf", "tcp\(.*:3306\)", "tcp(" + args.database_host + ":3306)")
-  if os.name == 'nt':
-    env = os.environ.copy()
-    env["GOPATH"] = r"C:\FrameworkBenchmarks\revel"
-    subprocess.call("go get -u github.com/robfig/revel/revel", shell=True, cwd="revel", env=env, stderr=errfile, stdout=logfile)
-    subprocess.call(r"go build -o bin\revel.exe github.com/robfig/revel/revel", shell=True, cwd="revel", env=env, stderr=errfile, stdout=logfile)
-    subprocess.Popen(r"bin\revel.exe run benchmark prod".rsplit(" "), shell=True, cwd="revel", env=env, stderr=errfile, stdout=logfile)
-    return 0
-  subprocess.call("go get -u github.com/robfig/revel/revel", shell=True, cwd="revel", stderr=errfile, stdout=logfile)
-  subprocess.call("go build -o bin/revel github.com/robfig/revel/revel", shell=True, cwd="revel", stderr=errfile, stdout=logfile)
-  subprocess.Popen("bin/revel run benchmark prod".rsplit(" "), cwd="revel", stderr=errfile, stdout=logfile)
-  return 0
-
-def stop(logfile, errfile):
-  if os.name == 'nt':
-    subprocess.call("taskkill /f /im benchmark.exe > NUL", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.call("taskkill /f /im revel.exe > NUL", shell=True, stderr=errfile, stdout=logfile)
-    return 0
-  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
-  out, err = p.communicate()
-  for line in out.splitlines():
-    if 'revel' in line and 'run-tests' not in line and 'run-ci' not in line:
-      pid = int(line.split(None, 2)[1])
-      os.kill(pid, 15)
-  return 0

+ 8 - 0
frameworks/Go/revel/setup.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Where to find the go executable
+export PATH="$GOROOT/bin:$PATH"
+
+go get -u github.com/robfig/revel/revel
+go build -o bin/revel github.com/robfig/revel/revel
+bin/revel run benchmark prod &

+ 0 - 3
frameworks/Go/webgo/bash_profile.sh

@@ -1,7 +1,4 @@
 # Set the root of our go installation
 export GOROOT=${IROOT}/go
 
-# Where to find the go executable
-export PATH="$GOROOT/bin:$PATH"
-
 export GOPATH=${TROOT}

+ 7 - 0
frameworks/Go/webgo/setup.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# Where to find the go executable
+export PATH="$GOROOT/bin:$PATH"
+
+go get ./...
+go run src/hello/hello.go &