talkative, friendly, programmer

The Remote-deployer Charm: Playing With Juju During a Tea Break

| Comments

The power of juju, and its model driven approach to deployments is undoubtedly the relationships. Being able to specify what services you depend on and what you provide to other services is extremely powerful.

To get all of those benefits you need to write your app as a charm. With the new layering approach ( this has got even easier. There will be more posts about that coming soon.

But I’ve always pondered the following:

Is there a useful shortcut around writing a charm that would let you deploy your app in < 5 minutes

My idea was the remote-deployer charm (

It doesn’t replace writing your own charm, indeed the cases in which it’s useful are limited. (you must have a publicly available file path that you want to deploy from) The intention is to facilitate playing with juju in less time than the typical tea break.

The idea goes:

  1. Deploy the charm
  2. Give it something to do
juju deploy cs:~mattyw/trusty/remote-deployer-2
juju action do remote-deployer/0 deploy source=

The something to do is just pointing it at some remote file tree (like a github url). It downloads this file tree and looks for a file called remote-deployer. It runs this as the ubuntu user. The example above installs the clojure build tool lein and creates a hello world web app (

# remote-deployer
set -ev
sudo apt-get install -y --force-yes openjdk-7-jre-headless
sudo cp lein /usr/bin
cd $HOME && lein new compojure-app my-app
cd $HOME/my-app && nohup lein ring server &
open-port 3000

Juju fans will notice that the normal hook tools are available to you in this file.

If you’d like to suggest or help make improvements the project is here:

Take a look at in action: