简体   繁体   English

Capistrano我如何使用两个deploy.rb文件

[英]Capistrano how can i use two deploy.rb files

I'm working with project on local machine where internet connection is so slowly. 我正在本地计算机上的项目中,互联网连接速度非常慢。 For best testing i have another server in other place with fast internet connection. 为了进行最佳测试,我在另一台具有快速互联网连接的服务器上。 To test my projects i'm use capistrano with puma. 为了测试我的项目,我将Capistrano与puma一起使用。 But my client use production environment on his server on capistrano with unicorn. 但是我的客户在独角兽的capistrano服务器上使用生产环境。

Question: 题:

How can i divide my puma_deploy.rb and (unicorn_)deploy.rb for work with both capistrano deployments? 如何将我的puma_deploy.rb和(unicorn_)deploy.rb划分为两个capistrano部署一起使用? PS when i push repo to client, i add puma_deploy.rb to .gitignore, to prevent confuse with clients administrators, which makes deploy from own repo to own server. PS,当我将回购推送到客户端时,我将puma_deploy.rb添加到.gitignore,以防止与客户端管理员混淆,​​从而使从自己的回购部署到自己的服务器。

It sounds like you could use the Capistrano Multistage extensions to manage your deployments in different environments. 听起来您可以使用Capistrano Multistage扩展来管理不同环境中的部署。

You could set up your environment (the one you use for testing) as a "staging" environment. 您可以将环境(用于测试的环境)设置为“暂存”环境。

However, I think it might be a better idea to just use the same thing for both your testing/staging environment as production. 但是,我认为在测试/过渡环境中与生产环境使用相同的内容可能是一个更好的主意。 If there is a problem with the webserver or its configuration, you might not know until it goes to production, then it is sad faces all around trying to track down the issue. 如果Web服务器或其配置有问题,您可能直到生产投入使用时才知道,那么令人难过的是,试图找出问题所在。

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

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