2

Recently I started to incorporate good practices in my development workflow, so I split the development server and the production one. I also incorporated a versioning system using Subversion (Tortoise SVN).

Now I have the problem of synchronize the production server (Apache shared hosting) with the files of the last development version in my local machine.

Before I didn't have this problem because I worked directly with the server files through Filezilla. But now I don't know how to transfer the files in an efficient way and what are the good practices in this aspect.

I read something about Ant and Phing but I'm not sure if this appropiate to me or is unnecessary complexity.

Memochipan
  • 3,185
  • 4
  • 31
  • 54
  • You said nothing about your deployment-policy: all commits to DEV must be transferred to PROD, how you organize DEV ad PROD workspaces: are they unversioned files or WC of your REPO (and which part of repo - trunk? "SomeBranch") – Lazy Badger Dec 12 '12 at 00:25

4 Answers4

2

Rsync is a cross-platform tool designed to help in situations like this; I've used it for similar purposes on multiple occasions. This DevShed tutorial may be of some help.

psema4
  • 2,957
  • 1
  • 15
  • 22
1

I don't think you want to "authomatize" it, rather establish control over your deployment and integration process. I generally like SVN but it has some bugs and one problem I have with it is that it doesn't support baselining -- instead you need to make a physical branch of your repository if you want to have a stable version to promote to higher environments while continuing to advance the trunk.

Anyway, you should look at continuous integration and Jenkins. This is a rather wide topic to which not a specific answer can be given. There are many ins, outs, what-have-yous. Depends on your application platform, components, do you have database changes, are you dealing with external web services or 3rd party APIs etc.

Community
  • 1
  • 1
amphibient
  • 25,192
  • 44
  • 130
  • 215
1

Maybe out there are more structured solutions but with Tortoise SVN you can export only the files changed between versions in a folder tree structure. And then, upload as always in Filezilla.

Take a look to: http://verysimple.com/2007/09/06/using-tortoisesvn-to-export-only-newmodified-files/

  • Using TortoiseSVN, right-click on your working folder and select “Show Log” from the TortoiseSVN menu.
  • Click the revision that was last published
  • Ctrl+Click the HEAD revision (or whatever revision you want to release) so that both the old and the new revisions are highlighted.
  • Right-click on either of the highlighted revisions and select “Compare revisions.” This will open a dialog window that lists all new/modified files.
  • Select all files from this list (Ctrl+a) then right-click on the highlighted files and select “Export selection to…”
Memochipan
  • 3,185
  • 4
  • 31
  • 54
0

Side note:

You have to open more details about your workflow and configuration - applicable solutions depends from it. I see 4 main nodes in game: Workplace, Repo Server, DEV, PROD, some nodes may be united (1+2, 2+3), may have different set of tools (do you have SSH, Rsync, NFS, Subversion clients on DEV|PROD). All details matter

In any case - Subversion repositories have such thing, as hooks, in your case post-commit hook (executed on Repository Server side after each commit) may be used

If this hook (any code, which can be executed in unattended mode) you can define and implement any rules for performing deploy to any target under any conditions. You must only know

  • Which transport will be used for transferring files
  • What is your webspaces on servers (Working Copies of just clean unversioned files - both solution have pro and contra sets) - it will define, which deployment-policy ("export" or "update") you have to implement in hook

Some links to scripts, which export files, affected by revision (or range of revisions) into unversioned tree

Community
  • 1
  • 1
Lazy Badger
  • 87,730
  • 7
  • 72
  • 97