How do you deploy a website to your webservers?

前端 未结 7 680
礼貌的吻别
礼貌的吻别 2020-12-24 08:59

At my company we have a group of 8 web developers for our business web site (entirely written in PHP, but that shouldn\'t matter). Everyone in the group is working on differ

相关标签:
7条回答
  • 2020-12-24 09:04

    You should consider using branching and merging for individual projects (on the same codebase), if they make huge changes to the shared codebase.

    we usually have a local dev enviroment for testing (meaning, webserver locally) for testing the uncommited code (you don't want to commit non functioning code at all), but that dev enviroment could even be on a separeate server using shared folders.

    however, committed code, should be deployed to a staging server for testing before putting it in production.

    0 讨论(0)
  • 2020-12-24 09:04

    You can probably use Capistrano even though is more for ruby there are some articles that describe how to use it for PHP

    I think Phing can be use with CVS but not with SVN (at least that what I last read)

    There are also some project around that mimic Capistrano but written in PHP.

    Otherwise there is also a custom made solution :

    1. tag files you want to deploy.
    2. checkout files using the tag in a
      specific directory
    3. symlink the directory to the current document root (easy to rollback to the previous version)
    0 讨论(0)
  • 2020-12-24 09:05

    I gave a similar answer yesterday to another question. Basically you can work in branches and integrate before going live.

    The biggest thing you will have to get your head round is that you are dealing with changes to files, rather than individual files. Once you have branches there isn't really a current version there are just versions with different changes in.

    0 讨论(0)
  • 2020-12-24 09:11

    Naturally check out SVN for the repository, Trac to track things, and Apache Ant to deploy.

    The basic process is managing in Subversion, tracking the repositroy and developers in Trac and using Ant deployment scripts to push your site out with the settings needed. Ant allows you to easily deploy a project to a specific location. (Dev/test/prod) etc.

    0 讨论(0)
  • 2020-12-24 09:15

    We check for the stability with ant, every night. And use ant script to deploy. It is very easy to configure and use.

    0 讨论(0)
  • 2020-12-24 09:17

    Cassy - you obviously have a long way to go before you'll get your source code management entirely in order, but it sounds like you are on your way!

    Having individual sandboxes will definitely help on things. Next then make sure that the website is ALWAYS just a clean checkout of a particular revision, tag or branch from subversion.

    We use git, but we have a similar setup. We tag a particular version with a version number (in git we also get to add a description to the tag; good for release notes!) and then we have a script that anyone with access to "do a release" can run that takes two parameters -- which system is going to be updated (the datacenter and if we're updating the test or the production server) and then the version number (the tag).

    The script uses sudo to then run the release script in a shared account. It does a checkout of the relevant version, minimizes javascript and CSS1, pushes the code to the relevant servers for the environment and then restarts what needs to be restarted. The last line of the release script connects to one of the webservers and tails the error log.

    On our websites we include an html comment at the bottom of each page with the current server name and the version -- makes it easy to see "What's running right now?"

    1 and a bunch of other housekeeping tasks like that...

    0 讨论(0)
提交回复
热议问题