开发者

Using Subversion and Pushing to Staging and then Live Sever

开发者 https://www.devze.com 2023-01-28 14:54 出处:网络
We want to add a staging server and version control to 开发者_StackOverflowour development pipeline. Our site is a complex web application running on a remote Linux server with PHP, MySQL, and Apache.

We want to add a staging server and version control to 开发者_StackOverflowour development pipeline. Our site is a complex web application running on a remote Linux server with PHP, MySQL, and Apache. We just set up Subversion on the office LAN and got it working in Dreamweaver CS5. Our development machines run Windows.

The question is how to best add a staging server to this set up. We're a small team, 3 developers, so we don't need an overly-robust/complex solution. What I don't understand is how to push changes from our Subversion repo (which is located on one of the developer's machines) to a staging server or the live server.

  1. I read a lot about people writing hooks for this, but does that mean we need to install Subversion on the staging server and the live server? I'd rather not do this.

  2. I want to upload files automatically to the Staging server as developers commit them to Subversion. How can this be done?

  3. Then I need an automated process for uploading files from the Staging server to the Live server. This is the part I really don't understand. Especially because I don't want to have Subversion installed on Live. How is this typically done?

  4. Are ALL the files from the Staging server pushed to Live? Or is there a way to only push the ones that changed since the previous push?

  5. I was hoping to use Windows XAMPP to set up the Staging server, but our Live server is Linux, and some of our site code has Linux-specific file paths, which seem like they won't work in Windows. How is this problem typically addressed? Is the only solution to create a new Linux Staging server? I'd rather avoid that if possible.

  6. On our site, users can upload images, which are stored in a separate folder outside the site root. Can Windows XAMPP work with such as set up? Our biggest challenge right now is making sure the same code works on Linux/Windows. What are some things to watch out for? Is this even possible in theory?

Thank you!


  1. Not required. The hooks can run on your version control server. The hooks should be capable of pushing the build to staging server.

  2. Hooks can provide these capabilities but why not separate it from version control.

  3. Automatic uploads means no control over when to push a build. Most of the time in development, intermediary builds are broken. I would suggest that you include a "continuos integration tool" like BuildBot in your workflow. This will do the job of reporting broken builds and current status of your build health. If you want, you could always use this mechanism to upload good builds to staging server automatically.

  4. Staging is used to test the build in a complete live environment which is difficult to replicate in your QA environment. So a build on staging may not be pushed to live environment, if it is found to be buggy.

  5. XAMPP does work on windows. Check it out on google. Although, your staging and live environment should be completely same because that is what staging environment is meant for.

  6. In theory, it should work. You will have to test your specific functionality.


For questions 1 and 2, you use a post-commit hook on your subversion repository (does not need to be on web servers), that will copy the latest version to your staging server.

Re 3), this is a bad idea, you should not automate deploys to production. A bad commit could bring down your site if you do this.

4, 5, and 6 are really different questions and should be asked separately.

0

精彩评论

暂无评论...
验证码 换一张
取 消