I have a “hooks only” charm which uses the old charmcraft layout. It can be seen here: GitHub - erik78se/tiny-bash: A tiny bash juju charm for educational purposes
This charm is also used in documentation here: https://juju.is/docs/sdk/pack-a-hooks-based-charm-with-charmcraft so I would like it to work and be accurate.
I was trying to update this charm to build for the new 24.04 - which wasn’t supported by the above mentioned charm.
After some major trial and error:s going through the docs. I managed to get it to build for a single base ubuntu@24.04:
name: tiny-bash
type: charm
title: A tiny bash charm.
summary: |
The tiny-bash deploys very fast.
description: |
The tiny-bash charm that use "hooks only" to deploy.
Since its super small and only uses hooks, it deploys very fast
base: ubuntu@24.04
platforms:
amd64:
build-on: amd64
build-for: amd64
config:
options: {}
parts:
tiny-bash:
plugin: dump
source: .
prime:
- LICENSE
- README.md
- copyright
- hooks
- icon.svg
But as soon as I try to add any other bases or anything, I run into various of errors. For example, like this:
name: tiny-bash
type: charm
title: A tiny bash charm.
summary: |
The tiny-bash deploys very fast.
description: |
The tiny-bash charm that use "hooks only" to deploy.
Since its super small and only uses hooks, it deploys very fast
bases:
- build-on:
- name: ubuntu
channel: "24.04"
run-on:
- name: ubuntu
channel: "24.04"
- name: ubuntu
channel: "22.04"
config:
options: {}
parts:
tiny-bash:
plugin: dump
source: .
prime:
- LICENSE
- README.md
- copyright
- hooks
- icon.svg
Bad charmcraft.yaml content: base requires ‘platforms’ definition: {‘name’: ‘ubuntu’, ‘channel’: ‘24.04’} (in field ‘bases[0]’)
Presently, I’m basically not able to add the support for multiple bases and at the same time swap to the new charmcraft.yaml format for charmcraft 3.0+.