Jump to:

23480 Posts in 18951 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Pushing code changes to a live site

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1062 Views
  • purplespider
    Avatar
    Community Member
    81 Posts

    Pushing code changes to a live site Link to this post

    I was wondering how people go about pushing code changes to a live site. Currently I:

    1 Test the changes on my local staging version of the site
    2 Uploaded the changed files
    3 Quickly rebuild the database once the uploads are complete
    4 Hope nothing's gone screwy!
    5 Then manually perform any CMS actions to use the changes, such as new pages etc

    Is this how others do it?

    Is there a better way? Avoid users accessing the site before the database has rebuilt?

    Do you lock the site during updates? If so how?

    Interested to hear how everyone does it.

    Many Thanks
    James

  • TotalNet
    Avatar
    Community Member
    181 Posts

    Re: Pushing code changes to a live site Link to this post

    4 Hope nothing's gone screwy!

    A database backup is always a good idea before you get to this stage ;)

    Do you lock the site during updates? If so how?

    There are a few ways, rewrite rules are the best way. you can have a ruleset before the SilverStripe stuff that checks for the existence of a file, e.g. closed-for-maintenance.html, redirect all requests to that page with an appropriate HTML status code (e.g. 307 Temporary Redirect).

    As for the whole process, a good stating point is source control, svn. Then it really depends on the scope of the change; is a db rebuild necessary? are you making changes to existing {Data}objects. And the most important thing is a roll-back plan, be sure you can put everything back the way it was 5 mins ago.

  • purplespider
    Avatar
    Community Member
    81 Posts

    Re: Pushing code changes to a live site Link to this post

    Perfect, thanks.

    My server does full backups each night, and I do a manual backup if I think large changes have been made.

    Regarding SVN, it's something I've tried to fit into my workflow many times (only using TimeMachine at the moment), but it's never stuck. From a SilverStripe site's root, which directorys/files should be in the repositry, and which are best to skip from SVN, assets etc?

    Thanks
    James

  • Willr
    Avatar
    Forum Moderator
    5502 Posts

    Re: Pushing code changes to a live site Link to this post

    I have all my SS core folders and modules as svn externals. The whole site is in svn but those folders are externals and the only folders which aren't externals are the 'mysite', 'assets' and 'themes' folders but mysite and themes are stored in svn.

    Externals documentation: http://svnbook.red-bean.com/en/1.0/ch07s03.html

    1062 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.