===================== 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= $ 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 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= $ juju add-relation charmworld mongodb $ juju add-relation charmworld elasticsearch:essearch # Wait 15-20 minutes to complete the first ingest. $ sshuttle -r 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