pack

Build and pack a charm operator package or a bundle.

You can juju deploy the resulting .charm or bundle’s .zip file directly, or upload it to Charmhub with charmcraft upload.

For the charm you must be inside a charm directory with a valid metadata.yaml, requirements.txt including the ops package for the Python operator framework, and an operator entrypoint, usually src/charm.py. See charmcraft init to create a template charm directory structure.

For the bundle you must already have a bundle.yaml (can be generated by Juju) and a README.md file.

Usage

charmcraft pack [options]

Options

--bases-index

Index of ‘bases’ configuration to build (can be used multiple times); zero-based, defaults to all.

--build-for

Set architecture to build for.

--debug

Shell into the environment if the build fails.

--destructive-mode

Build in the current host.

--force

Force packing even after finding lint errors.

--format

Produce a machine-readable format (currently only json).

--include-all-charms

For bundles, pack all charms whose source is inside the bundle directory.

--include-charm

For bundles, pack the charm in the referenced path. Can be used multiple times.

--measure

Dump measurements to the specified file.

--output or -o

Output directory for created packages.

--output-bundle

Write the bundle configuration to this path.

--platform

Set platform to build for.

--project-dir or -p

Specify the project’s directory (defaults to current).

--shell

Shell into the environment in lieu of the step to run.

--shell-after

Shell into the environment after the step has run.

--use-lxd

Build in a LXD container.

Global options

-h or --help

Show this help message and exit.

-q or --quiet

Only show warnings and errors, not progress.

-v or --verbose

Show debug information and be more verbose.

--verbosity

Set the verbosity level to ‘quiet’, ‘brief’, ‘verbose’, ‘debug’ or ‘trace’.

-V or --version

Show the application version and exit.