|
@@ -1,24 +1,28 @@
|
|
|
|
|
|
import subprocess
|
|
import subprocess
|
|
import sys
|
|
import sys
|
|
|
|
+import time
|
|
import os
|
|
import os
|
|
|
|
|
|
def start(args, logfile, errfile):
|
|
def start(args, logfile, errfile):
|
|
if os.name == 'nt':
|
|
if os.name == 'nt':
|
|
- subprocess.check_call('"..\\sbt\\sbt.bat" ";start;shell"', shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
|
|
|
|
|
|
+ subprocess.check_call('"..\\sbt\\sbt.bat" assembly', shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
|
|
else:
|
|
else:
|
|
- subprocess.check_call('../sbt/sbt ";start;shell"', shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
|
|
|
|
-
|
|
|
|
|
|
+ subprocess.check_call("../sbt/sbt assembly", shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
|
|
|
|
+
|
|
|
|
+ subprocess.Popen("java -jar dist/curacao-standalone.jar", shell=True, cwd="curacao", stderr=errfile, stdout=logfile)
|
|
|
|
+
|
|
|
|
+ time.sleep(5)
|
|
return 0
|
|
return 0
|
|
|
|
|
|
def stop(logfile, errfile):
|
|
def stop(logfile, errfile):
|
|
if os.name == 'nt':
|
|
if os.name == 'nt':
|
|
- subprocess.check_call("wmic process where \"CommandLine LIKE '%sbt-launch%'\" call terminate", stderr=errfile, stdout=logfile)
|
|
|
|
|
|
+ subprocess.check_call("wmic process where \"CommandLine LIKE '%curacao-standalone%'\" call terminate", stderr=errfile, stdout=logfile)
|
|
else:
|
|
else:
|
|
p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
|
|
p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
|
|
out, err = p.communicate()
|
|
out, err = p.communicate()
|
|
for line in out.splitlines():
|
|
for line in out.splitlines():
|
|
- if 'sbt-launch' in line:
|
|
|
|
|
|
+ if 'curacao-standalone' in line:
|
|
try:
|
|
try:
|
|
pid = int(line.split(None, 2)[1])
|
|
pid = int(line.split(None, 2)[1])
|
|
os.kill(pid, 15)
|
|
os.kill(pid, 15)
|
|
@@ -29,4 +33,3 @@ def stop(logfile, errfile):
|
|
|
|
|
|
##start([], open('log.out','a'), open('error.out','a'))
|
|
##start([], open('log.out','a'), open('error.out','a'))
|
|
##stop(open('log.out','a'), open('error.out','a'))
|
|
##stop(open('log.out','a'), open('error.out','a'))
|
|
-
|
|
|