简体   繁体   English

Ruby on Rails-测试Capistrano的deploy.rb的更改

[英]Ruby on Rails - Testing changes to Capistrano's deploy.rb

I'm trying to test some changes out on production without having to commit and push the changes because I only want to commit what actually works. 我试图测试生产中的某些更改,而不必提交并推送更改,因为我只想提交实际有效的内容。 The project I'm working on was created with Rails (3.0.2), and deploys with Capistrano (3.1). 我正在处理的项目是使用Rails(3.0.2)创建的,并使用Capistrano(3.1)进行了部署。 I've tried making changes in the root folder of my app and redeploying, and the changes are not reflected on the website. 我尝试在应用程序的根文件夹中进行更改并重新部署,但更改未反映在网站上。 I've tried making changes in the root/current directory and redeploying and that didn't work. 我尝试在root/current目录中进行更改并重新部署,但这种方法不起作用。

Is there any way I can redeploy changes to the server without having to push it to Github first? 有什么方法可以将更改重新部署到服务器,而不必先将其推送到Github?

Is there any way I can redeploy changes to the server without having to push it to Github first? 有什么方法可以将更改重新部署到服务器,而不必先将其推送到Github?

No this isn't possible since one of the first things that Capistrano will do is git clone the latest from whatever branch you've specified in your deploy config. 不可能,这是不可能的,因为Capistrano要做的第一件事就是git clone从您在deploy config中指定的任何分支git clone最新版本。

I'm not sure what your familiarity with Rails is but the proper way to do this would be to create a new staging environment and deploy to that. 我不确定您对Rails的熟悉程度如何,但是执行此操作的正确方法是创建一个新的登台环境并进行部署。 The staging environment would have similar settings to your production environment with a separate database so that you don't affect production data. 暂存环境将具有与生产环境类似的设置(具有单独的数据库),这样您就不会影响生产数据。

Capistrano 3 supports this flow out of the box so that once you've set everything up you can simply call Capistrano 3支持开箱即用的流程,因此,设置完所有内容后,您可以直接致电

cap staging deploy

to deploy to the staging environment, and 部署到登台环境,以及

cap production deploy

to deploy to the production environment. 部署到生产环境。

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

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