Do you use any deployment tool to deploy play-framework

301 views
Skip to first unread message

howa

unread,
Nov 6, 2012, 9:15:05 AM11/6/12
to play-fr...@googlegroups.com
Just want to know what is your preferred way to deploy play-framework based application?

Do you use any third party deployment tools like fabric?

Thanks.

Marcel Klemenz

unread,
Nov 6, 2012, 9:21:43 AM11/6/12
to play-fr...@googlegroups.com
We use a script that uses rsync over ssh.
First it precompiles the app, stops the application remotely, than it syncs the code (without delete, you don't want your attachments to be removed) and at last it restarts the application. Works, is fast and secure.

Adam Lane

unread,
Nov 6, 2012, 3:49:52 PM11/6/12
to play-fr...@googlegroups.com
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


Cory Watson

unread,
Nov 6, 2012, 9:36:14 AM11/6/12
to play-fr...@googlegroups.com
On Nov 6, 2012, at 8:15 AM, howa <howa...@gmail.com> wrote:

Just want to know what is your preferred way to deploy play-framework based application?

Do you use any third party deployment tools like fabric?

I use capistrano and it works quite well.

Cory G Watson
@gphat

Message has been deleted

Giovanni

unread,
Nov 7, 2012, 7:25:08 PM11/7/12
to play-fr...@googlegroups.com
I use capistrano for my ruby on rails projects. I didn't know that it is usable also for Play.

Can you give us some references (tutorials, links, etc.) about the utilization of capistrano with Play?

Best regards,
giovanni


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

Cory Watson

unread,
Nov 7, 2012, 8:48:38 PM11/7/12
to play-fr...@googlegroups.com

On Nov 7, 2012, at 6:25 PM, Giovanni <pino...@gmail.com> wrote:

I use capistrano for my ruby on rails projects. I didn't know that it is usable also for Play.

Can you give us some references (tutorials, links, etc.) about the utilization of capistrano with Play?

I can't think of much that capistrano isn't usable for.  If combined with railsless-deploy[0] it's very capable, just poorly documented.

Here's a sample of my cap file: https://gist.github.com/4035968


Cory G Watson
@gphat

Reply all
Reply to author
Forward
0 new messages