简体   繁体   English

Web开发; 没有服务器源控制支持

[英]Web development; no server source control support

I'm developing web app using CodeIgniter PHP framework. 我正在使用CodeIgniter PHP框架开发Web应用程序。 The server I'm working with does not support any type of source control (ie Subversion) unless you go to a higher price tier. 我正在使用的服务器不支持任何类型的源代码控制(即Subversion),除非你去更高的价格层。

I would still like to put the code under some sort of source control. 我仍然希望将代码置于某种源代码控制之下。 Does it make sense to do the following: 执行以下操作是否有意义:

  1. Install git or SVN on my local machine and develop there 在我的本地机器上安装git或SVN并在那里开发
  2. Copy changes from my local machine to development directory on the server (using FileZilla, WinSCP, etc.) and test 将更改从本地计算机复制到服务器上的开发目录(使用FileZilla,WinSCP等)并进行测试
  3. Copy changes from development directory to production directory on the server 将更改从开发目录复制到服务器上的生产目录

Does that sound reasonable? 这听起来合理吗? Are there better alternatives? 还有更好的选择吗? Thanks! 谢谢!

如果你在本地使用svn它有点危险,因为那时你还需要保护你的计算机 - 我认为最好的方法是使用商业网站提供完全支持的svn / git - 比如http://www.beanstalkapp.com /http://www.github.com

You could use source control on your local machine (SVN, Git, etc.) and use an open source tool like Capistrano to deploy the code from your local source control repo to your server via SSH. 您可以在本地计算机(SVN,Git等)上使用源代码控制,并使用Capistrano等开源工具通过SSH将代码从本地源代码控制存储库部署到服务器。 Or if you're limited to FTP, this blog post has a potential solution. 或者,如果您仅限于FTP,此博客文章有一个潜在的解决方案。

An advantage of using a tool like Capistrano instead of directly mirroring the files on your local machine to the server via FileZilla or WinSCP is that Capistrano will version your deployed files so that, if you end up breaking something and need to roll back quickly to the previously-deployed version, it can be as easy as changing a symlink to the previous deployment directory. 使用像Capistrano这样的工具而不是通过FileZilla或WinSCP直接将本地计算机上的文件镜像到服务器的优点是Capistrano将对已部署的文件进行版本化,这样,如果您最终破坏某些内容并需要快速回滚到以前部署的版本,可以像将符号链接更改为以前的部署目录一样简单。

Does that sound reasonable? 这听起来合理吗?

Partially, in p.1. 部分地,在第1页。 But even in this case I'll suggest to have your repository also at some Repository-Hosting (BitBucket, GitHub, Assembla) 但即使在这种情况下,我也建议你的存储库也在一些Repository-Hosting(BitBucket,GitHub,Assembla)

For pp. 2-3: your deploys must to be automatic and non-interactive, thus - you'll have to select another tools (for using in post-commit hook of SCM-of-choice) 对于第2-3页:您的部署必须是自动且非交互式的 - 因此 - 您必须选择其他工具(用于在SCM-of-choice的post-commit钩子中使用)

Somehow better alternative to 2-3 may be: 以某种方式更好的替代2-3可能是:

  • Use 2 different branches (DEVEL and PROD) as sources of DEVEL and PROD dir 使用2个不同的分支(DEVEL和PROD)作为DEVEL和PROD目录的源
  • Post-commit hook, which upload only changed in committed revision files to corresponding dir (NCFTP for FTP, SCP with scenario for ssh) 提交后挂钩,上传仅在已提交的修订文件中更改为相应的目录(用于FTP的NCFTP,用于ssh的方案的SCP)
  • Main development happens in DEVEL branch 主要开发发生在DEVEL分支
  • PROD have only mergesets from DEVEL PROD 只有DEVEL的合并集

Workflow is SCM-agnostic and scalable to any reasonable amount of branches and developers 工作流与SCM无关,可扩展到任何合理数量的分支机构和开发人员

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

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