Browse Source

Revel on Windows

Rob Figueiredo 12 years ago
parent
commit
d16816e1e2
3 changed files with 19 additions and 6 deletions
  1. 13 0
      installer.ps1
  2. 0 4
      revel/setup.bat
  3. 6 2
      revel/setup.py

+ 13 - 0
installer.ps1

@@ -195,4 +195,17 @@ $env:Path += ";$maven_dir\bin"; [Environment]::SetEnvironmentVariable("Path", $e
 Write-Host "Configuring firewall...`n"
 Write-Host "Configuring firewall...`n"
 New-NetFirewallRule -DisplayName "HTTP 8080" -Action Allow -Direction Inbound -LocalPort 8080 -Protocol TCP | Out-Null
 New-NetFirewallRule -DisplayName "HTTP 8080" -Action Allow -Direction Inbound -LocalPort 8080 -Protocol TCP | Out-Null
 
 
+#
+# Mercurial
+#
+Write-Host "Installing Mercurial...`n"
+
+$hg_installer_file = "mercurial-2.6.1-x64.msi"
+$hg_installer_url = "https://bitbucket.org/tortoisehg/files/downloads/$hg_installer_file"
+$hg_installer_local = "$workdir\$hg_installer_file"
+(New-Object System.Net.WebClient).DownloadFile($hg_installer_url, $hg_installer_local)
+
+Start-Process $hg_installer_local '/passive' -Wait
+$env:Path += ";C:\Program Files\Mercurial"; [Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)
+
 cd $basedir
 cd $basedir

+ 0 - 4
revel/setup.bat

@@ -1,4 +0,0 @@
-set GOPATH=C:\FrameworkBenchmarks\revel
-go get -u github.com/robfig/revel
-go build -o bin\revel.exe github.com/robfig/revel/cmd
-bin\revel.exe benchmark prod 8080

+ 6 - 2
revel/setup.py

@@ -7,7 +7,11 @@ import time
 def start(args):
 def start(args):
   setup_util.replace_text("revel/src/benchmark/conf/app.conf", "tcp\(.*:3306\)", "tcp(" + args.database_host + ":3306)")
   setup_util.replace_text("revel/src/benchmark/conf/app.conf", "tcp\(.*:3306\)", "tcp(" + args.database_host + ":3306)")
   if os.name == 'nt':
   if os.name == 'nt':
-    subprocess.Popen("setup.bat", shell=True, cwd="revel")
+    env = os.environ.copy()
+    env["GOPATH"] = r"C:\FrameworkBenchmarks\revel"
+    subprocess.call("go get github.com/robfig/revel/cmd", shell=True, cwd="revel", env=env)
+    subprocess.call(r"go build -o bin\revel.exe github.com/robfig/revel/cmd", shell=True, cwd="revel", env=env)
+    subprocess.Popen(r"bin\revel.exe run benchmark prod".rsplit(" "), shell=True, cwd="revel", env=env)
     return 0
     return 0
   subprocess.call("go get github.com/robfig/revel/cmd", shell=True, cwd="revel")
   subprocess.call("go get github.com/robfig/revel/cmd", shell=True, cwd="revel")
   subprocess.call("go build -o bin/revel github.com/robfig/revel/cmd", shell=True, cwd="revel")
   subprocess.call("go build -o bin/revel github.com/robfig/revel/cmd", shell=True, cwd="revel")
@@ -16,7 +20,7 @@ def start(args):
 
 
 def stop():
 def stop():
   if os.name == 'nt':
   if os.name == 'nt':
-    subprocess.call("taskkill /f /im go.exe > NUL", shell=True)
+    subprocess.call("taskkill /f /im benchmark.exe > NUL", shell=True)
     subprocess.call("taskkill /f /im revel.exe > NUL", shell=True)
     subprocess.call("taskkill /f /im revel.exe > NUL", shell=True)
     return 0
     return 0
   p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
   p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)