If you are using Amazon EC2 here is some info I have gathered thanks to other posters here in the past.
I like to use s3tools to copy dist file to s3 bucket.
Once your
deployment zip is in s3, then it is quick for all your other instances to pull it. To install on an AMI:
sudo yum --enablerepo epel install s3cmd
(If this fails then you probably have not allowed enough outgoing
and incoming traffic to your EC2 Security Group.
http://docs.amazonwebservices.com/AmazonVPC/latest/UserGuide/VPC_Appendix_NACLs.html)
s3cmd --configure
(
http://s3tools.org/s3cmd)
Local build script to dist and push to s3:
play compile stage
play -Dconfig.file=conf/amazon.conf dist
python c:\python27\scripts\s3cmd put dist/mentormyself-1.0.zip s3://mentormyself
Use a local Fabric script to initiate remote pull (sleep and pty settings to get around some scp bugs):
def release():
run('./doRelease.sh & sleep 5;', shell=True, pty=False)deRelease.sh on EC2 (which is also set to run at startup for autoscaled instances to autostart)
#!/bin/bash
rm /tmp/mentormyself-1.0.zip
s3cmd get s3://mentormyself/mentormyself-1.0.zip /tmp
killall java || true
rm -rf mentormyself
mkdir mentormyself
unzip -q /tmp/mentormyself-1.0.zip -d mentormyself
sh mentormyself/mentormyself-1.0/start -Dhttp.port=8080 >out 2>&1 &
Better yet use "supervisor" to start and stop play as service (
https://groups.google.com/forum/#!topic/play-framework/BlV4c3q8hxE)
using something like this in your config
[program:mytest]
user=ec2-user
command=/home/ec2-user/appdir/appdis-1.0/start -Dconfig.resource=amazon.conf -Dlogger.resource=logger-prod.xml -Dhttp.port=8080 -Dpidfile.path=/dev/null
stderr_logfile=/var/log/mytest/stderr.log
stdout_logfile=/var/log/mytest/stdout.log