Alex
Alex

Reputation: 749

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 (i.e. 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!

Upvotes: 1

Views: 108

Answers (3)

Lazy Badger
Lazy Badger

Reputation: 97280

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

Upvotes: 1

Stuart M
Stuart M

Reputation: 11588

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.

Upvotes: 1

Adidi
Adidi

Reputation: 5253

If you are using svn locally it's a bit dangerous because then you will need to protect also your computer - I think the best way is to work with the commercial sites offer fully supported svn/git - like http://www.beanstalkapp.com/ or http://www.github.com

Upvotes: 2

Related Questions