排除使用Capistrano部署的文件,同时仍然使用Git进行版本控制 [英] Excluding files from being deployed with Capistrano while still under version control with Git

查看:120
本文介绍了排除使用Capistrano部署的文件,同时仍然使用Git进行版本控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开始使用qUnit测试我的Rails应用程序中的JavaScript,我想知道如何保持测试JavaScript,并在版本控制下测试运行器的HTML页面(当然我使用Git),但是将它们关闭使用Capistrano部署应用程序时的生产服务器。我的第一个想法是让Capistrano像往常一样发送所有的代码,包括测试文件,并在部署过程结束时编写一个任务来删除它们。这似乎是一种黑客,但是。在部署时,有没有更清楚的方法告诉Capistrano忽略存储库的某些部分?

解决方案

截至2013年8月30日,您可以简单地创建一个 .gitattributes 文件和 export-ignore 您选择的文件/文件夹。

  features / export-ignore 
spec / export-ignore

参考: https://github.com/ capistrano / capistrano / pull / 626


I want to start testing the JavaScript in my Rails apps with qUnit and I'm wondering how to keep the test JavaScript and test runner HTML page under version control (I'm using Git, of course) but keep them off the production server when I deploy the app with Capistrano. My first thought is to let Capistrano send all the code over as usual including the test files, and write a task to delete them at the end of the deployment process. This seems like sort of a hack, though. Is there a cleaner way to tell Capistrano to ignore certain parts of the repository when deploying?

解决方案

As of August 30th, 2013, you can simply create a .gitattributes file and export-ignore the files/folders of your choice.

features/ export-ignore
spec/     export-ignore

Reference: https://github.com/capistrano/capistrano/pull/626

这篇关于排除使用Capistrano部署的文件,同时仍然使用Git进行版本控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆