juju-solutions / layer-cwr

Layer for building the Juju Jenkins CI env

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

Build Status License

This subordinate charm prepares a Jenkins master node to test Juju artifacts (charms and bundles). All tests are isolated in a LXC container.

Deployment

A working Juju installation is assumed to be present. If Juju is not yet set up, please follow the getting-started instructions prior to deploying this charm.

This charm is intended to be deployed as part of the cwr-ci bundle:

juju deploy cs:~juju-solutions/cwr-ci

Note: CWR requires Juju 2.1.0 or greater.

This will deploy Jenkins with this charm acting as the charm/bundle test mechanism. More information about this deployment can be found in the bundle readme.

Status

This charm provides extended status to indicate when it is ready:

juju status

This is particularly useful when combined with watch to track the on-going progress of the deployment:

watch -c juju status --color

The message column will provide information about this unit's state.

Network-Restricted Environments

Charms can be deployed in environments with limited network access. To deploy in this environment, configure a Juju model with appropriate proxy and/or mirror options. See Configuring Models for more information.

Configuration

Custom Test Container

As mentioned earlier, all tests are isolated in a LXC container. The default container image includes all software necessary to run cwr. Optionally, you may provide your own container image. To create an image, see the ./scripts/build-cwrbox-image utility. Use your custom image by either:

  • Attaching a resource to this charm:

    juju attach cwr cwrbox=./myimage.tgz
    
  • Configuring this charm with the URL/key of a remotely hosted image:

    juju config cwr \
        cwrbox_image=<url> \
        cwrbox_keys=<gpg-fingerprint-of-image-signer>
    

Grant Access to CWR

To run tests, this charm needs access to your controller(s) to create models and allocate resources needed to run charm/bundle tests. The steps required to do this are covered in detail in the Getting Started section of the cwr-ci bundle readme. A summary of the procedure is as follows:

  • Add a user to your controller(s)
  • Grant add-model permissions to the new user(s)
  • Run the register-controller action
  • Run the set-credentials action
  • Optionally run the store-login action

Usage

The test capabilities of this charm are covered in detail in the Workflows section of the cwr-ci bundle readme. At a glance, the following usage scenarios are supported via charm actions:

  • Test a charm when a commit is made to a charm source repository
  • Test a charm when a release is created in a Github charm source repository
  • Test a charm when a pull request is created in a Github charm source repository
  • Test a bundle when an included charm is updated in the Charm Store

Resources

Community

Technical

CWR leverages a plethora of tooling from the Juju ecosystem. Details can be found at the following project links:

About

Layer for building the Juju Jenkins CI env

License:Other


Languages

Language:Python 84.0%Language:Shell 15.5%Language:Makefile 0.5%