Pack a reactive based charm with Charmcraft

:construction: Available on Charmcraft’s edge channel

Charms can be created in different ways. By default, Charmcraft will use the Charmed Operator SDK, but by defining the appropriate parts it can be also used to pack other types of charms.

Step 1: Setting up a reactive charm project

Install the required tools

snap install charm --classic

And create a new project:

charm create tutorial

Change to the tutorial directory and modify metadata.yaml so it looks like the following:

name: tutorial
summary: test
maintainer: maintainer <>
description: |
    Longer description than summary
  - misc
subordinate: false
series: [focal]

Step 2: Create charmcraft.yaml

Create a charmcraft.yaml file with the part definition for the reactive-based charm. The file contents should be:

type: "charm"
  - build-on:
      - name: "ubuntu"
        channel: "20.04"
      - name: "ubuntu"
        channel: "20.04"
    source: .
    plugin: reactive
    build-snaps: [charm]

Step 3: Pack

To create the charm run the following:

$ charmcraft pack

The final output should look something like the following:

Charms packed:

Step 4: Inspecting

The charm can be analyzed to verify everything is correct, to do so run:

$ charmcraft analyze tutorial_ubuntu-20.04-amd64.charm

The result should look something like the following:

- language: unknown (                              
- framework: reactive (                           
Lint OK:                                                                                                         
- juju-actions: no issues found (              
- juju-config: no issues found (                
- metadata: no issues found (