English 中文(简体)
Need advice on my PHP development solution
原标题:

Here is how our current php development solution is set up:

Each developer work on their local machine. Each developer commit their change to a common SVN server (intranet). A commit hook upload the change to the staging server and perform validations tasks. When the product is ready, manually deploy it to the production server via SFTP.

Note: Most - if not all - of the time I don t have SSH access to the server, only SFTP.

I could automate the deployment to the production server in the same way the staging server is updated but this solution works only one-way. How can I revert to a previous revision in case of problems?

How can I improve this solution?

Thanks and sorry for my English.

最佳回答

If you can set up the production server to access the SVN repo via a secure channel, such as https with webdav maybe try the following:

Create a script on the Production server that allows you to enter a tag directory and/or revision number/date and perform an svn export. This way, the prod server is pulling the changes from svn.

Now, if you have a way to have this script called securely from, say a commit script. Voila, you have automation.

Most importantly, you do not want an automatic update performed to the prod server that you were not planning for.

To solve this:

The commit script should only call the prod update script when something is committed to "/path/to/tags/release/dir"

Make sure only appropriate change control staff (or whoever currently controls the manual prod deplyment) have the ability to perform an svn copy to this directory in the repo.

For example, say your repo is set up as:

/yourWebsite
--> /branches
--> /trunk
--> /tags
----> /releases

The commit that would trigger the auto deployment to prod would be something like:

svn copy https://mySvnRepo/yourWebSite/trunk 
   https://mySvnRepo/yourWebSite/tags/releases/x.y 
   -m "Tagging for production deployment"

Rolling back can be achieved by making a commit to a previous releases directory. Note however, that this will not cause new files that were added to be rolled back.

Of course, your mileage may vary; this is only a suggestion for your investigation. You should take time to consider the security implications and potential for disaster if set up incorrectly.

Hope this helps, even if only to get you thinking of other solutions.

问题回答

暂无回答




相关问题
Best practices for Subversion and Visual Studio projects

I ve recently started working on various C# projects in Visual Studio as part of a plan for a large scale system that will be used to replace our current system that s built from a cobbling-together ...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository ...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix find command, with which I can find the location of a file in a repository. I know there is svn list, but ...

热门标签