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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Using flush=all with sake


Go to End


4 Posts   3546 Views

Avatar
theorytank

Community Member, 8 Posts

16 April 2011 at 5:08am

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

Community Member, 8 Posts

16 April 2011 at 5:23am

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

Community Member, 8 Posts

16 April 2011 at 6:18am

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

Forum Moderator, 5523 Posts

16 April 2011 at 5:32pm

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");