Changeset 520
- Timestamp:
- 03/15/14 01:47:44 (11 years ago)
- Location:
- Dev/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/Gruntfile.js
r519 r520 178 178 body: { 179 179 source: "<%= herokuConfig.CLOUDANT_URL %>/<%= dbName %>", 180 target: "<%= dbName %>" 180 target: "<%= dbName %>", 181 create_target: true 181 182 }, 182 183 json: true … … 189 190 body: { 190 191 source: "<%= dbName %>", 191 target: "<%= herokuConfig.CLOUDANT_URL %>/<%= dbName %>" 192 target: "<%= herokuConfig.CLOUDANT_URL %>/<%= dbName %>", 193 create_target: true 192 194 }, 193 195 json: true -
Dev/trunk/README.md
r464 r520 9 9 with _Grunt_, a node based task runner. 10 10 11 First make sure _node_, _npm_ and _couchdb_ are installed. Then 12 install all dependencies by running `npm install`. To run _grunt_, 13 you'll have to install the commandline client with `npm install -g 14 grunt-cli`. 11 First make sure _node_, _npm_, _couchdb_, _heroku_, _formena_, _git_ 12 and _svn_ are installed. To run _grunt_, you'll have to install the 13 commandline client with `npm install -g grunt-cli`. 14 15 QED can run in two modes, _dev_ and _production_. This is controlled 16 by the environment variable `QED_ENV`. If it is not present, _dev_ is 17 the assumed mode. In development mode, QED runs agains another 18 database than in production. So, to run the production server, you 19 must use `QED_ENV=production grunt run`. Usually when developing you 20 will use the dev mode and you can omit the QED_ENV variable. The value 21 of QED_ENV on heroku is already set to production (this can be done 22 with `heroku config:set QED_ENV=production --app quod-erat` and is 23 persisent). 15 24 16 25 From source to a deployable version goes in few steps. 17 1. Develop in `src`. 18 1. Create a development version with `grunt build`. This will put a 19 complete uncompressed version in `build/development`. 20 1. Run the development version with `node server/standalone.js` or 21 `foreman start`. For the last option, you have to have the Heroku 22 chain installed. 23 1. When editing more files, you can skip copying the fixed 24 dependencies and only process our own source files by running 25 `grunt compile`. If dependencies change (e.g. you installed node 26 modules) or you have the feeling something is weird, just do a 27 clean build by running `grunt build` again. Don't forget to 28 restart the server. 29 1. When you feel your changes are production ready, create a 30 production version by running `grunt deploy`. This will do a 31 _Dojo_ build on the client, creating compressed CSS and 32 Javascript. 33 1. You can test this version with the same commands as the 34 development version, but now from the `build/production` 35 directory. You can distribute the content is this directory as a 36 release. 37 1. If you want to deploy to Heroku, do the following: 38 ```sh 39 $ git clone git@heroku.com:quod-erat.git build/quod-erat 40 $ cd build/quod-erat 41 $ rm -rf * 42 cp -r ../production/* . 43 git add . 44 git commit -a -m "Something informative goes here..." 45 git push 46 ``` 26 1. Develop in `src`. You can run `grunt` (or `grunt compile`) to do 27 compiling of Coffee and LESS sources and linting of Javascript, 28 HTML etc. 29 1. Run a server with `grunt run` and test. If client sources are 30 changed, you only have to run `grunt compile` and reload the 31 browser, for server sources you have to restart it. 32 1. You can create a _Dojo_ build with `grunt build`, which will merge 33 and compress sources. You can also run `grunt run-build`, which 34 will do the build and start it locally for testing. 35 1. When you feel your changes are production ready, you can deploy to 36 Heroku by running `grunt deploy`. The heroku app must know about 37 _quod-erat_ already, so you might have to add it by hand the first 38 time. 47 39 48 File organisation 49 ----------------- 40 ## Database management 41 42 There are _grunt_ tasks to push local database to Cloudant, pull the 43 oter way or make a backup of the Cloudant database. Which database is 44 used (dev or production) is again controlled by `QED_ENV`. 45 46 In `src/server/bin` are some scripts to check if all database 47 documents are valid and to upload the latest version of the design 48 documents. Both the design documents and the database schema are 49 versioned and QED won't start if the versions don't match. 50 51 If an update required changes to (normally) immutable documents, you 52 can disable the modification check with 53 `config-db-for-upgrade.js`. It's usually a good idea to write and 54 update script instead of doing things by hand. Don't forget to restore 55 the check with `config-db.js`, although a server restart will also do 56 that for you. 57 58 Synchronisation doesn't ignore validation checks, so if you had to 59 disable the validation to do an upgrade, you also have to disable 60 validation on the database that you synchronize to. Currently this is 61 not automated, so you have to run the scripts yourself in a sane 62 order. 63 64 If you want to test locally but with the Cloudant database instead of 65 localhost, run like `CLOUDANT_URL=<ur> QED_ENV=dev grunt run`. You can 66 get the url by running `heroku config:get CLOUDANT_URL --app 67 quod-erat`. 68 69 ## File organisation 50 70 51 71 * _/_ Project root
Note: See TracChangeset
for help on using the changeset viewer.