cwr ci #2

Supports: xenial

Add to new model


This bundle deploys a reference platform for building, testing, and releasing
Juju Charms and Bundles into the Juju Charm Store. The CI used in this bundle
is Jenkins, paired with the following charm-specific tools:

The cornerstone of this bundle is Cloud Weather Report (CWR). The cwr charm
handles CI requests (e.g. from from a webhook), manages the necessary models on
your controller(s), dispatches jobs to Jenkins, provides job status to the
requester, and can automatically release charms to your namespace in the charm

Note: We have a variation of this bundle called cwr-rq that includes all of the same components plus the Review Queue. If you are interested in a
charm/bundle CI system that includes a source review application, we
recommend you have a look at cwr-rq.

Bundle Composition

The charms that comprise this bundle are colocated on 1 machine. Additional
information about these charms can by found in the following linked READMEs:

Getting Started

Note: A bootstrapped Juju controller is required. If Juju is not yet set up, please follow the getting-started instructions prior to deploying this

Deploy this bundle from the charm store:

juju deploy cwr-ci

Charms in this bundle provide status messages to indicate their readiness.
Monitor the progress of the deployment with:

watch juju status

Note: Once the charms indicate they are ready, use Ctrl-c to terminate the watch command and proceed with the following instructions.

Set a password for Jenkins:

juju config jenkins password=<yourpassword>

CWR needs access to your controller(s) to create models and allocate resources
needed to run charm/bundle tests. Grant this by creating a user on
your bootstrapped controller(s) with appropriate permissions:

juju add-user ciuser
juju grant ciuser add-model

To register the controller with the CWR charm, you will need to call the
register-controller action and provide a human-friendly name and the registration token from the above juju add-user command.

juju run-action cwr/0 register-controller name=<controller-name> \

You should also setup a session with the charm store to allow CWR to release
charms to your namespace. To do this, call the store-login action and provide
the base64 representation of an existing auth token. For example:

charm login
export TOKEN=`base64 ~/.local/share/juju/store-usso-token`
juju run-action cwr/0 store-login charmstore-usso-token="$TOKEN"

At this point, you have the foundation for a powerful charm/bundle CI system.
Workflows that leverage this system are described in the next section.


Manage the Charm Release Cycle from Github


Our goal is to build and test a charm/bundle every time code is committed to a
repository. In light of a successful test, the resulting charm/bundle is pushed
to the store and released in the edge channel. Similarly, releases to the
stable channel can be made by tagging the code in Github when ready.

The rationale of this workflow is that you want charm/bundle updates released as
soon as you are confident that things are working as expected. With good tests,
the CI system can give you that confidence and automatically handle the release
process from a source repo to an edge or stable channel in the charm store.


  • A charm/top charm layer, e.g.: awesome-charm
  • Source repository on Github, e.g.:
  • A charm store namespace, e.g.: awesome-team


To include awesome-charm in our CI pipeline, we need to call the
build-on-commit action:

juju run-action cwr/0 build-on-commit \
    repo= \
    charm-name=awesome-charm \
    push-to-channel=edge \
    lp-id=awesome-team \

This will instruct CWR to run a Jenkins job to test awesome-charm on your
lxd controller and release it to the edge channel each time you commit to your repo.

For releasing awesome-charm to the stable channel, we need a similar call to
the build-on-release action:

juju run-action cwr/0 build-on-release \
    repo= \
    charm-name=awesome-charm \
    push-to-channel=stable \
    lp-id=awesome-team \

This will instruct CWR to run a Jenkins job to test awesome-charm on your
aws controller and release it to the stable channel any time you tag your source with a release tag.

Both actions above take an optional reference-bundle parameter (e.g.: reference-bundle=~awesome-team/awesome-bundle). If provided, CWR will build and deploy a local version of awesome-charm along with the reference bundle.
Bundle tests will then be executed to verify the charm is working as expected
within the bundle.


We have described an example workflow that can leverage the charm/bundle CI system
provided by this bundle. Do you have ideas or other workflows built around
CWR? Please let us know by contacting us on the mailing list below.


Bundle configuration

Embed this bundle

Add this card to your website by copying the code below. Learn more.