Changeset 520


Ignore:
Timestamp:
03/15/14 01:47:44 (11 years ago)
Author:
hendrikvanantwerpen
Message:

Updated README and made syncs more resilient.

Location:
Dev/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/Gruntfile.js

    r519 r520  
    178178                    body: {
    179179                        source: "<%= herokuConfig.CLOUDANT_URL %>/<%= dbName %>",
    180                         target: "<%= dbName %>"
     180                        target: "<%= dbName %>",
     181                        create_target: true
    181182                    },
    182183                    json: true
     
    189190                    body: {
    190191                        source: "<%= dbName %>",
    191                         target: "<%= herokuConfig.CLOUDANT_URL %>/<%= dbName %>"
     192                        target: "<%= herokuConfig.CLOUDANT_URL %>/<%= dbName %>",
     193                        create_target: true
    192194                    },
    193195                    json: true
  • Dev/trunk/README.md

    r464 r520  
    99with _Grunt_, a node based task runner.
    1010
    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`.
     11First make sure _node_, _npm_, _couchdb_, _heroku_, _formena_, _git_
     12and _svn_ are installed. To run _grunt_, you'll have to install the
     13commandline client with `npm install -g grunt-cli`.
     14
     15QED can run in two modes, _dev_ and _production_. This is controlled
     16by the environment variable `QED_ENV`. If it is not present, _dev_ is
     17the assumed mode. In development mode, QED runs agains another
     18database than in production. So, to run the production server, you
     19must use `QED_ENV=production grunt run`. Usually when developing you
     20will use the dev mode and you can omit the QED_ENV variable. The value
     21of QED_ENV on heroku is already set to production (this can be done
     22with `heroku config:set QED_ENV=production --app quod-erat` and is
     23persisent).
    1524
    1625From 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.
    4739
    48 File organisation
    49 -----------------
     40## Database management
     41
     42There are _grunt_ tasks to push local database to Cloudant, pull the
     43oter way or make a backup of the Cloudant database. Which database is
     44used (dev or production) is again controlled by `QED_ENV`.
     45
     46In `src/server/bin` are some scripts to check if all database
     47documents are valid and to upload the latest version of the design
     48documents. Both the design documents and the database schema are
     49versioned and QED won't start if the versions don't match.
     50
     51If an update required changes to (normally) immutable documents, you
     52can disable the modification check with
     53`config-db-for-upgrade.js`. It's usually a good idea to write and
     54update script instead of doing things by hand. Don't forget to restore
     55the check with `config-db.js`, although a server restart will also do
     56that for you.
     57
     58Synchronisation doesn't ignore validation checks, so if you had to
     59disable the validation to do an upgrade, you also have to disable
     60validation on the database that you synchronize to. Currently this is
     61not automated, so you have to run the scripts yourself in a sane
     62order.
     63
     64If you want to test locally but with the Cloudant database instead of
     65localhost, run like `CLOUDANT_URL=<ur> QED_ENV=dev grunt run`. You can
     66get the url by running `heroku config:get CLOUDANT_URL --app
     67quod-erat`.
     68
     69## File organisation
    5070
    5171 * _/_ Project root
Note: See TracChangeset for help on using the changeset viewer.