Eclipse, PHP, SVN and RSync

This post to share my configuration as I am developing a PHP application and I have the following:

  • SVN server where the code exists.
  • Staging/testing server where I should run and test my code.
  • My laptop where I write my code.

svn-developer-testing-server

In ideal scenarios the requirements are as the following:

  • Code tracking:
    • The code should be tracked and versioned in SVN.
  • Quality of the code:
    • While I am coding I have to test on the testing server.
    • I should commit only the good and working code into SVN server.
  • Fast development:
    • Time needed to build and move my code to the testing server should be minimized.

To meet my requirements, I am using the following tools on my development machine:

1- Eclipse
2- Eclipse Subversive
3- RSync

The only manual configuration needed is to configure  RSync as eclipse builder. I created a new “Program” type builder and then I used this command line:

rsync -e 'ssh -i PATH_TO/id_rsa' -avh SOURCE_DIR root@vps:TARGET_DIR

builder

If you prefer to synchronize with each save then we have the option to enable this builder to be run “During Auto Build” from Build Options tab and we enable “Build Automatically” from Project menu item.