简体   繁体   中英

Web development; no server source control support

I'm developing web app using CodeIgniter PHP framework. The server I'm working with does not support any type of source control (ie Subversion) unless you go to a higher price tier.

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
  2. Copy changes from my local machine to development directory on the server (using FileZilla, WinSCP, etc.) and test
  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. Or if you're limited to FTP, this blog post has a potential solution.

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.

Does that sound reasonable?

Partially, in p.1. But even in this case I'll suggest to have your repository also at some 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)

Somehow better alternative to 2-3 may be:

  • Use 2 different branches (DEVEL and PROD) as sources of DEVEL and PROD dir
  • Post-commit hook, which upload only changed in committed revision files to corresponding dir (NCFTP for FTP, SCP with scenario for ssh)
  • Main development happens in DEVEL branch
  • PROD have only mergesets from DEVEL

Workflow is SCM-agnostic and scalable to any reasonable amount of branches and developers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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