I believe I see your problem. So, you pulled this charm from github which is fine. However, tests are usually written and run from within the tests
directory. So, amulet applies a little bit of magic to deploy using the charm on disk so you don't have to explicitly put charm=
in the d.add
line. However, since you're running from interactive shell it makes sense for you to do this. The problem is, it's not a Bazaar branch which is what Juju Deployer is expecting.
Typically, what happens, when you just do d.add('cf-nats')
in a charm test, the charm tree gets copied to a temporary location, and a bzr repo is created (if one doesn't exist already). Then that new temp location is fed to deployer. However, since you've given it a firm file path that part isn't happening (by design) and it assumes you have a charm that has a bzr repo and it's just going to use that.
The way around this is to either run export JUJU_TEST_CHARM="cf-nats"
(and environment variable the juju test plugin sets) prior to launching your Python3 shell from the $CHARM_DIR
(/home/ubuntu/cf-charms/charms/trusty/cf-nats
) or after creating d = amulet.Deployment()
set d.charm_name = 'cf-nats'
. Then just do d.add('cf-nats')
, amulet will see that the basename of getcwd is the same as the charm name and transparently perform it's little bit of magic.
That should do it. Ideally, adding support for git based charms to juju deployer will resolve all of this, but try that and let me know if it doesn't work for you.
In order to get your charms to show up in the charm browser you will need to push them to your own namespace in Launchpad. Less than 15 minutes later, assuming charm proof passes, you'll be able to see your own charm in there.
You can read about this process here: https://jujucharms.com/docs/stable/authors-charm-store#submitting-a-new-charm
Just FYI, there is no technical difference between dragging from the Charm Browser and dragging a zip archive of your charm from your machine.
Best Answer
The latest version of the Juju GUI (cs:precise/juju-gui-85 at the time of writing) supports working with local charms.
It requires Juju version 1.17.3 or higher.
In order to work with local charms in the GUI you simply drag and drop a .zip archive of your charm onto the canvas portion of the GUI. You can even use this same procedure to upgrade already deployed charms with a local charm.
To deploy a local charm via the command line you would use the following command: