23355 Posts in 17838 Topics by 2862 members
|Go to End|
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:
$_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.
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:
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?
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.
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");
|Go to Top|