~jcsackett/charmworld/bac-tag-constraints

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
=====================
Hacking on Charmworld
=====================


Adding Dependency
=================

Charmworld uses virtualenv to isolate the environment. In order to add a new
package as a requirement you need to add it to the `requirements.txt` file and
make sure you lock the version.

The make target `make deps` will then install the new dependency.

*Note* The package must exist in the download cache. See `lp:~juju-jitsu/charmworld/download-cache`.

CSS Work
========

Charmworld is currently using the Ubuntu CSS framework. Additional classes may
be added in static/css/base.css but that should be avoided unless absolutely
necessary.

Auto Updating
-------------
You can use a tool like `watchdog`_ to auto update the css when you're hacking
on it. A sample watchdog command would be:

::

    bin/watchmedo shell-command \
    --patterns="*.less" \
    --command='make css' charmworld/static/css/


.. _Bootstrap: http://bootstrap.lesscss.ru/
.. _theme: http://bootswatch.com/united/
.. _watchdog: http://pypi.python.org/pypi/watchdog


Hacking with Canonistack
========================

::

    # Canonistack
    $ source ~/.canonistack/novarc
    $ juju bootstrap
    $ juju status

    # Wait for environment to come up
    $ juju deploy mongodb --constraints instance-type=m1.small
    $ juju set mongodb dbpath=/mnt/mongodb
    $ juju deploy cs:~charming-dev/precise/elasticsearch --constraints instance-type=m1.small
    $ juju deploy cs:~juju-jitsu/precise/charmworld --constraints instance-type=m1.small
    $ juju set charmworld error-email=<your email address>
    $ juju add-relation charmworld mongodb
    $ juju add-relation charmworld elasticsearch:essearch

    # If giving a public address (which is rare)
    $ juju expose charmworld
    $ euca-describe-instances
    $ euca-associate-address -i i-XXXXX XX.XX.XX.XX

    # Wait 15-20 minutes to complete the first ingest.
    $ sshuttle -r <charmworld ip> <charmworld ip>


Hacking with local (lxc)
========================

::

    $ juju bootstrap
    $ juju status
    $ juju deploy mongodb
    $ juju set mongodb dbpath=/mnt/mongodb
    $ juju deploy cs:~charming-dev/precise/elasticsearch
    $ juju deploy cs:~juju-jitsu/precise/charmworld
    $ juju set charmworld error-email=<your email address>
    $ juju add-relation charmworld mongodb
    $ juju add-relation charmworld elasticsearch:essearch

    # Wait 15-20 minutes to complete the first ingest.
    $ sshuttle -r <charmworld ip> <charmworld ip>


Hacking locally
===============

Running locally will install a number of packages, but if you don't mind it is
a fine way to proceed.

::
    $ make sysdeps
    $ make install
    $ make run
    $ bin/enqueue --prefix=~charmers/charms/precise --limit=100
    $ bin/ingest-queued


Contributing work
=================

Charmworld is hosted on Launchpad at https://launchpad.net/charmworld.  Most
conversations about development occur on IRC in the Freenode #juju-gui
channel.  Find us there if you'd like to contribute changes back to the
project. 

All code must be reviewed and approved before landing.  Reviews can either be
done solely on Launchpad as "merge proposals" or by using the "lbox" tool to
coordinate reviews between Launchpad and Google's "Rietveld" review system.

If doing your reviews on Launchpad you simply need to get an approval vote,
add a commit message, and then mark the merge proposal as "Approved".  The
continuous integration landing mechanism will then merge your branch against
trunk and run the acceptance tests.  If all tests pass the branch will be
merged for you and "staging.jujucharms.com" updated with the new revision.

If you do use lbox you must install it from the Ubuntu archives.

::
   $ sudo apt-get install lbox

You'll also need to install the Bazaar "rvsubmit" plugin.

::
   $ bzr branch lp:rvsubmit ~/.bazaar/plugins/rvsubmit

Submitting a proposal via lbox
------------------------------

::
   $ bzr branch lp:charmworld
   # Make your changes.
   $ lbox propose
   # Make changes from review.
   $ bzr rv-submit