版本控制和在各处安装文件的复杂应用程序
我必须开发网络应用程序。版本控制的目录结构如下:
appname/conf
appname/www
appname/etc
appname/keys
appname/lib
...
但是,为了使应用程序正常工作,它当前必须位于系统目录中:
/etc/httpd/conf.d
/var/www/html
/etc/appname
/etc/pki/tls/
/usr/lib/perl5/...
...
有一个 RPM 可以获取 VC 代码并创建一个包,将代码放入生产位置(即/var/www/html 等)。没有安装说明,我应该使用 RPM 并即兴创作(我知道这并不理想)。
在这种情况下,每个人如何编辑应用程序、维护版本控制功能(git diff 等...)以及对应用程序进行快速更改以使其可运行?该应用程序是用 Perl 编写的,因此不需要编译步骤。
我想到的方法是:
- 在 VC'ed 目录上工作(并且代码不会立即执行,您必须执行一些安装步骤)
- 在最终位置中的代码上工作(因此代码编辑立即工作,但您有手动将代码移回 VC'ed 目录)
- 编写一个文件系统监视程序,该程序监视对 VC'ed 目录的更改,并将更改的文件安装到其最终位置(也许存在类似的东西?)
- 我有一些其他明显的方法忘记了,希望有人能告诉我:-)
大家都是怎么处理这样的情况的?
I have to work on a web application. The version control has directories structured like:
appname/conf
appname/www
appname/etc
appname/keys
appname/lib
...
However, for the application to work, it currently has to live in system directories:
/etc/httpd/conf.d
/var/www/html
/etc/appname
/etc/pki/tls/
/usr/lib/perl5/...
...
There is an RPM to take the VC'ed code and create a package that places the code into the production place (i.e. /var/www/html and others). There are no install instructions, I'm supposed to use the RPM and improvise (not ideal I know).
In a case like this, how does everybody edit the application, maintaining version control features (git diff etc...), and making changes to the app quick to be runnable? The app is written in Perl, so there's no compile step expected.
The ways I have thought of are:
- work on the VC'ed dir (and the code does not execute immediately, you have to have some install step)
- work on the code in the final location (so code edits immediately work, but you have to manually move code back to VC'ed dirs)
- write a filesystem watching program that watches changes to the VC'ed dir, and installs the changed files to their final locations (maybe something like this exists?)
- some other obvious method I've forgotton, I hope someone can tell me :-)
How does everyone handle cases like this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将在某种测试服务器上处理代码,但代码位于正确的位置。然后,版本控制需要能够从各自的位置获取必要的文件,但是在准备好之前,您不会部署到“最终”位置(因此,正如您所说,这基本上是一个“安装”步骤)。
由于将内容更改为更明智可能不是您直接的选择,因此您是否可以从系统目录到 VC 目录进行符号链接?
I would be working on the code on a test server of some kind, but with the code in the correct locations. The version control then would need to be able to pick up the necessary files from their respective locations, but you don't deploy to the "final" location until ready (so that would basically be an "install" step, as you put it).
Since changing things to be more sensible may not directly be an option for you, is it possible for you to symlink from the system directories to the VC directory?
之间存在差异:
某种持续集成流程(基于调度程序,例如 Hudson)可以帮助您一旦进行新的提交,就监视 VC 并构建/部署。
There is a difference between:
Some kind of Continuous Integration process (based on a scheduler like Hudson) can help you monitor the VC and build/deploy as soon as a new commit is made.