Changes between Initial Version and Version 3 of Ticket #2950
- Timestamp:
- 10/02/12 10:42:44 (19 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #2950
- Property Summary changed from paster commands to prepare codebase for deployment to paster command to minify javascript and css
-
Ticket #2950 – Description
initial v3 3 3 - the fanstatic_resources defined in `ckan/lib/fanstatic_resources.py` (bottom of module) should be prepared, and minified. 4 4 5 This ticket is to provide a paster command which when run on a production server with a user of sufficient rights will prepare minified versions of the javascript required by CKAN. 5 This ticket is to: 6 7 - provide a paster command which when run will generate the minified javascript as css files. 8 - stop the auto-minification of files when CKAN starts up. 9 - remove reference to the minified files in the `.gitignore` file. 10 - add instruction to the release process to run this command, and check-in the minified files to the repo. 6 11 7 12 ## Background 8 13 9 Minification *should* work seamlessly without the need for any preparation when CKAN is started (and does so on a development setup). But on a production site, the webserver will (almost certainly) not have write-access to the directories that will contain the minified javascript. And so the minification will fail, and the site will end up serving the un-minified media.14 Currently, minification works seamlessly without the need for any preparation when CKAN is started in a development setup. But on a production site, the webserver will (almost certainly) not have write-access to the directories that will contain the minified files. And so the minification will fail, and the site will end up serving the un-minified media, or even *old* minified media. 10 15 11 16 One way around this would be to allow webserver write access to the directory its serving out of. But this is not generally considered good practice. 12 17 13 Another method would be to have a paster command which, when run as a user with the appropriate permissions, would generate the minified files. This should be achiveable by just importing the `fanstatic_resources.py` module. I think that's sufficient, but have not checked it.18 Another method would be to distribute the minified files with CKAN. This ticket describes how to do this without causing a lot of noise in the commit history of the repo. 14 19 20 The auto-minifcation occurs when importing `ckan/lib/fanstatic_resources.py`. 21 22 ## Changing the process slightly 23 24 The reason for moving away from auto-minifying files at start-up, to minifying files when running a paster command is: 25 26 - we should be distributing the minified files when we make a release (as we do with translation files). This makes it easier to install CKAN from source. 27 28 - if we distribute the minified files, then they need to be checked-in to the repo. 29 30 - if they are auto-minified, whenever small changes are made, then this will create a lot of noise in the repo. It will be clearer to have the minified-files generated manually as part of the release process. (Or whever we make a deployment internally).