How to configure Charmcraft

See also:

You have installed Charmcraft. This document shows you how you can configure it.

Configuring Charmcraft is mandatory for all project-handling commands, though optional for some store-related commands.


Find the configuration file

The charmcraft tool configuration is specified in a charmcraft.yaml file located in the project’s root directory.

By default, Charmcraft will try to find that file in the current directory, but in case of needing to run charmcraft outside the project’s directory, it can be specified using the global option --project-dir.

Get acquainted with its contents

See charmcraft.yaml.

Consult some examples

The following illustrate some implementations of the above spec:

type: bundle
  # these fields are set to the default value to illustrate field usage
  # likely not required in most cases
    prime: [""]

A different example, with a more comprehensive base definition:

type: charm
    - build-on:
        - name: ubuntu
          channel: "20.04"
          architectures: ["amd64"]
        - name: ubuntu
          channel: "21.04"
              - amd64
              - aarch64
              - arm64

Start configuring!

Start modifying the examples above to suit your own needs.

Last updated 1 year, 7 months ago. Help improve this document in the forum.