Skip to content

Commit

Permalink
Fix setup script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Gao committed Mar 28, 2013
1 parent 5b3a886 commit 8528ef9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions play-scala/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

def start(args):
setup_util.replace_text("play-scala/conf/application.conf", "jdbc:mysql:\/\/.*:3306", "jdbc:mysql://" + args.database_host + ":3306")

subprocess.check_call("play dist", shell=True, cwd="play-scala")
subprocess.check_call("unzip play-scala-1.0-SNAPSHOT.zip", shell=True, cwd="play-java/dist")
subprocess.check_call("chmod +x start", shell=True, cwd="play-scala/dist/play-java-1.0-SNAPSHOT")
subprocess.Popen("./start", shell=True, cwd="play-scala/dist/play-java-1.0-SNAPSHOT")
subprocess.check_call("unzip play-scala-1.0-SNAPSHOT.zip", shell=True, cwd="play-scala/dist")
subprocess.check_call("chmod +x start", shell=True, cwd="play-scala/dist/play-scala-1.0-SNAPSHOT")
subprocess.Popen("./start", shell=True, cwd="play-scala/dist/play-scala-1.0-SNAPSHOT")

return 0
def stop():
p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
out, err = p.communicate()
for line in out.splitlines():
if 'play' in line and 'java' in line:
if 'play' in line and 'scala' in line:
pid = int(line.split(None, 2)[1])
os.kill(pid, 9)
try:
os.remove("play-scala/RUNNING_PID")
except OSError:
pass

return 0

0 comments on commit 8528ef9

Please sign in to comment.