简体   繁体   English

Playframework 2-部署到ec2

[英]Playframework 2 - Deploying to ec2

I know that i can use the play dist command to upload it to an ec2 instance without any problems but the size is 35mb and I don't want to wait 60min for every tiny change. 我知道我可以使用play dist命令将其上传到ec2实例,而不会出现任何问题,但是大小为35mb,我不想等待60分钟进行每次微小的更改。 (I have dsl 1000) (我有dsl 1000)

Is it possible to use something like heroku where you just push your changes via git command? 是否可以使用诸如heroku之类的东西,而您只是通过git命令推送更改?

I think that would require a custom AMI with a working play2 installation. 我认为这需要具有可正常运行的play2安装的自定义AMI。

If you want to use git for deployment, you'll have to install the git server on your EC2 instance. 如果要使用git进行部署,则必须在您的EC2实例上安装git服务器。

Then, you'll have to come up with some scripting, by heavily using git hooks , in particular, the post-receive hook on the server side. 然后,您将不得不使用大量git hooks来编写一些脚本,特别是服务器端的post-receive钩子。

Roughly: 大致:

  1. Execute the clean , compile and stage tasks 执行cleancompilestage任务
  2. if everything fines, stop the old play application, and start the new one (in target/start ) 如果一切正常,请停止旧的播放应用程序,然后启动新的应用程序(在target/start

假设您的开发环境也在ec2上,那么最好从开发服务器创建一个反映更改的新AMI,然后部署该新AMI。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM