Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

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

Using flush=all with sake


Reply

4 Posts   1133 Views

Avatar
theorytank

16 April 2011 at 5:08am Community Member, 8 Posts

I have a site that deploys from SVN to various servers. (Dev, Staging and Production). I have a fairly straight forward script that runs the SVN update, the runs sake like so:

sake dev/build flush=all

All works fine, however when you go to the live site it's as if the flush=all didn't run. I then have to login as admin and run the flush=all as a url parameter otherwise it doesn't find new templates and classes.

I'm using an _ss_environment file to specify the domain names as so:

// Staging
$_FILE_TO_URL_MAPPING['/home/user/public_html'] = 'http://www.sitename.com/';

It's like two different caches are being kept. One for sake, and one for the site.

This makes deployment a little slower than I'd like. Any idea why the flush=all through sake isn't working on the site itself?

These sites are in "test" and "live" modes. I'm not sure if this fails in dev mode as I don't need to deploy to that site as it's the dev site.

Avatar
theorytank

16 April 2011 at 5:23am Community Member, 8 Posts

Ok.. a little more info. I dug into the tmp directory and I seem to have two manifest files:

manifest-cli-script
manifest-main

Obviously one from sake and one from main.php (which is sapphire). Not sure why it would do that. I guess an easy (but unpredictable solution) would be to copy the cli one over top of the main one after doing the flush, however that seems really hacky.

Any other thoughts?

Avatar
theorytank

16 April 2011 at 6:18am Community Member, 8 Posts

Solved it, but I don't love the hack.

First I tried copying the file which worked fine. Then I did some digging and found the code that generated the path. So, if I pre-define it in my _ss_environment.php file then all works as expected.

define("MANIFEST_FILE", getSysTempDir() . '/silverstripe-cache' . str_replace(array(' ', "/", ":", "\\"), "-", dirname(__FILE__) ) . "/manifest-main");

It's not pretty, but it works.

Avatar
Willr

16 April 2011 at 5:32pm Forum Moderator, 5511 Posts

Obviously one from sake and one from main.php (which is sapphire). Not sure why it would do that.

It appends the name of the root PHP files onto the mainfest (line 5 on MainfestBuilder). I cannot track down why it would do this. I assume it would be because most cli uses may involve a different user than the webserver user so to avoid permission issues it keeps it separate. From the looks of 3.0 this behaviour has been removed for a single file.

If you want to keep a single manifest file then you can hard code this in your _config or _ss_environment

define('MANIFEST_FILE', TEMP_FOLDER . "/manifest-main");