How to integrate a local charm into a bundle

To integrate a local charm into a bundle, you will need a local bundle file, say bundle.yaml, where the charm field points to the directory of the charm in question. Here is an example:

series: xenial
applications:
  mysql:
    charm: "/home/ubuntu/charms/mysql"
    num_units: 1
    constraints: mem=2G cores=4

The bundle can then be deployed by using the file as the argument instead of a bundle name:

juju deploy ./bundle.yaml

With juju-2.9.42 it’s necessary to add charm file path, e.g.

applications:
  mysql:
    charm: "/home/ubuntu/charms/mysql/mysql_ubuntu-22.04-amd64.charm"
    num_units: 1

Failing to do so, is resulting in error like:

ERROR cannot deploy bundle: invalid charm "mysql": has no hooks nor dispatch file