|
@@ -3,17 +3,17 @@ import sys
|
|
import setup_util
|
|
import setup_util
|
|
import os
|
|
import os
|
|
|
|
|
|
-def start(args):
|
|
|
|
|
|
+def start(args, logfile, errfile):
|
|
setup_util.replace_text("ninja/src/main/resource/conf/application.conf", "mysql:\/\/.*:3306", "mysql://" + args.database_host + ":3306")
|
|
setup_util.replace_text("ninja/src/main/resource/conf/application.conf", "mysql:\/\/.*:3306", "mysql://" + args.database_host + ":3306")
|
|
|
|
|
|
try:
|
|
try:
|
|
- subprocess.check_call("mvn clean compile assembly:single", shell=True, cwd="ninja")
|
|
|
|
- subprocess.check_call("java -Dninja.port=8080 -Dninja.mode=prod -Dninja.context=/ninja -jar ninja/target/hello-ninja-standalone-0.0.1-SNAPSHOT-jar-with-dependencies.jar", shell=True)
|
|
|
|
|
|
+ subprocess.check_call("mvn clean compile assembly:single", shell=True, cwd="ninja", stderr=errfile, stdout=logfile)
|
|
|
|
+ subprocess.check_call("java -Dninja.port=8080 -Dninja.mode=prod -Dninja.context=/ninja -jar ninja/target/hello-ninja-standalone-0.0.1-SNAPSHOT-jar-with-dependencies.jar", shell=True, stderr=errfile, stdout=logfile)
|
|
return 0
|
|
return 0
|
|
except subprocess.CalledProcessError:
|
|
except subprocess.CalledProcessError:
|
|
return 1
|
|
return 1
|
|
|
|
|
|
-def stop():
|
|
|
|
|
|
+def stop(logfile, errfile):
|
|
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():
|