What is a good solution for deploying PHP / MySQL site via FTP?

I am currently working on a web application using PHP and MySQL, but I do not have access to the server on the server (working on this issue already ...). Currently I have source control with subversion on my local machine and I have a database on my local machine that I have made all the changes to. Then, once I have checked all the updates on my local machine, I deploy the site manually. I am using filezilla to download updated files and then deletes the local database and import them to the deployment server.

Obviously my current solution is nowhere near ideal. For one important purpose, I need a way to avoid copying my .svn files ... Does anyone know what the best solution for this particular setup would be? I've looked a bit in Capistrano and Ant, but they both look like it's a problem that I don't have shell access ...

0


source to share


3 answers


You can do a subversion export (not checkout) to another directory from your working copy, then it will remove all .svn for you.



+1


source


I am using Weex to sync a server over FTP. Weex is basically a non-interactive FTP client that automatically downloads and deletes files / directories on a remote server. It can be configured to not load specific paths (such as SVN directories), as well as keep certain remote paths (such as log directories).

Unfortunately I don't have a solution to sync MySQL databases ...



Perhaps you could log the changes to the database in "SQL scripts" (or use full dumps), load them using Weex, and invoke a remote PHP script that subsequently performs the SQL fixes.

+3


source


I am using rsync in production, but you can do this:

Add a config table to your site to store the level you are currently at.

During development, save each set of SQL changes to a single file (I use something like delta_X-up.sql). They will also remain in your SVN. So, for example, if you are in delta_5 and add a table between the current version and the new version, all the required SQL will be put in delta_6-up.sql

When it's time to build, export the repo instead of checking out. This allows you to ignore all SVN feed that comes in since you don't need it.

Use Weex to make these changes to production (that would be if I was using rsync, but you don't have that option). Call a remote script that checks your config DB to see what delta level you are at, analyze the directory with delta_x-up.sql files and see if there are any new ones. If there are, read them and run the SQL inside.

+2


source







All Articles