How to use charm resources in a bundle
Bundles support charm resources (see Using resources) through the use of the
resources key. Consider the following charm
metadata.yaml file that includes a resource called
name: example-charm summary: "example charm." description: This is an example charm. resources: pictures: type: file filename: pictures.zip description: "This charm needs pictures.zip to operate"
It might be desirable to use a specific resource revision in a bundle:
applications: example-charm: charm: "cs:example-charm" series: trusty resources: pictures: 1
So here we specify a revision of ‘1’ from the Charm Store.
resources key can also specify a local path to a resource instead:
applications: example-charm: charm: "cs:example-charm" series: trusty resources: pictures: "./pictures.zip"
Local resources can be useful in network restricted environments where the controller is unable to contact the Charm Store.
Last updated 11 months ago.