Charmcraft Configuration

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.

The just released Charmcraft v0.8.0 makes this configuration file mandatory for the bundle-related pack command, but so far is optional for the rest of the commands. This will change in the next release, when the charmcraft.yaml file becomes mandatory for all project-handling commands (will keep being optional for some store-related commands).

Configuration content

The following are the fields available in the configuration file. Everything is optional unless stated otherwise.

  • type: The type of entity for which the present config exists. E.g. charm or bundle. Mandatory for the pack command, will become mandatory for some commands in 0.9.0.

  • charmhub: Holds details or configuration for the store client to interact with the servers:

    • api_url: the base url to use Charmhub’s API layer

    • storage_url: the base url to push binaries to Charmhub

  • parts: This is a list of files/directories to include in the built file (currently for a bundle, will used for charms in the future). It has a specific structure in preparation for future changes:

    parts:
        bundle:
            prime: [...]  # the list of files to include