Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 19 additions & 21 deletions docs/howto/manage-channels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,32 @@ When you register a name on Charmhub, that automatically creates 4 channels, all
track ``latest`` but with different risk levels, namely, ``edge``, ``beta``,
``candidate``, ``stable``, respectively.

See more: :ref:`register-a-name`
See more: :ref:`register-a-name`

.. raw:: html
.. A charm channel consists of three pieces, in this order: <track>/<risk>/<branch>.
<!--
A charm channel consists of three pieces, in this order: <track>/<risk>/<branch>.
.. The <risk> refers to one of the following risk levels:
The <risk> refers to one of the following risk levels:
.. stable: (default) This is the latest, tested, working stable version of the charm.
.. candidate: A release candidate. There is high confidence this will work fine, but there may be minor bugs.
.. beta: A beta testing milestone release.
.. edge: The very latest version - expect bugs!
stable: (default) This is the latest, tested, working stable version of the charm.
candidate: A release candidate. There is high confidence this will work fine, but there may be minor bugs.
beta: A beta testing milestone release.
edge: The very latest version - expect bugs!
.. When you register, you get a track called `latest` with all the usual risk levels. So, you get all of:
When you register, you get a track called `latest` with all the usual risk levels. So, you get all of:
.. latest/stable
.. latest/candidate
.. latest/beta
.. latest/edge
latest/stable
latest/candidate
latest/beta
latest/edge
.. This counts as 4 separate channels. They're created implicitly. (They're only _opened_ if you release a revision to them.)
This counts as 4 separate channels. They're created implicitly. (They're only _opened_ if you release a revision to them.)
.. The track is what you request a guardrail and create a new of (not the channel).
The track is what you request a guardrail and create a new of (not the channel).
Later on, if you specify a channel, you get:
- An implicit stable risk, if you don't declare a risk.
- An implicit empty branch, if you don't declare a branch.
-->
.. Later on, if you specify a channel, you get:
.. - An implicit stable risk, if you don't declare a risk.
.. - An implicit empty branch, if you don't declare a branch.
View the available channels
---------------------------
Expand All @@ -57,13 +53,15 @@ The following output shows four channels, all of which have the same track, ``la
but different risk levels, namely, ``edge``, ``beta``, ``candidate``, and ``stable``.

.. terminal::
:output-only:

Track Channel Version Revision
latest stable - -
candidate - -
beta 0.1 1
edge ↑ ↑

..
See more: :ref:`ref_commands_status`

Expand Down
30 changes: 12 additions & 18 deletions docs/howto/manage-charmcraft.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,12 @@ to `these instructions <https://brew.sh/>`_).

brew install charmcraft

.. terminal::

==> Downloading https://ghcr.io/v2/homebrew/core/charmcraft/manifests/1.3.2
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/charmcraft/blobs/sha256:ebe7aac3dcfa401762faaf339a28e64bb5fb277a7d96bbcfb72bdc
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:ebe7aac3dcfa401762faaf339a28e64bb5fb277a7d
######################################################################## 100.0%
==> Pouring charmcraft--1.3.2.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/charmcraft/1.3.2: 2,205 files, 17.2MB

Charmhub commands work natively:

.. code-block:: bash
.. terminal::

charmcraft whoami

name: John Doe
username: jdoe
id: xxxxxxxxxxxxxxxxxxxxxxxxx
Expand All @@ -76,12 +67,10 @@ In macOS, Charmcraft defaults to Multipass to build the charms in a container ma
the target bases. Running pack asks to setup Multipass if not already installed, and
continues with the packing process:

.. code-block:: bash

$ charmcraft pack

.. terminal::

charmcraft pack

Multipass is required, but not installed. Do you wish to install Multipass and configure it with the defaults? [y/N]: y
==> Downloading https://github.com/canonical/multipass/releases/download/v1.7.2/multipass-1.7.2+mac-Darwin.pkg
Already downloaded: /Users/jdoe/Library/Caches/Homebrew/downloads/4237fcef800faa84459a2911c3818dfa76f1532d693b151438f1c8266318715b--multipass-1.7.2+mac-Darwin.pkg
Expand Down Expand Up @@ -119,11 +108,16 @@ a fresh new VM with 4 cores, 8GB RAM and a 20GB disk and the name ‘charm-dev':

Last, open a shell in your new Ubuntu virtual machine, and install Charmcraft there:

.. code-block:: bash
.. terminal::

multipass shell charm-dev
...
ubuntu@charm-dev:~$ sudo snap install charmcraft --classic

.. terminal::
:user: ubuntu
:host: charm-dev
Comment on lines +111 to +117

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These will get merged into a single terminal session once we bump the sphinx-terminal version.


sudo snap install charmcraft --classic

charmcraft 2.2.0 from Canonical✓ installed

That's it. You can now start typing in Charmcraft commands.
Expand Down
30 changes: 8 additions & 22 deletions docs/howto/manage-charms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -544,37 +544,31 @@ is just a zip file with metadata and the operator code itself.

Pack the charm:

.. code-block:: bash
.. terminal::

charmcraft pack

.. terminal::

Created 'microsample-vm_ubuntu-22.04-amd64.charm'.
Charms packed:
microsample-vm_ubuntu-22.04-amd64.charm

Optionally, verify that this has created a .charm file in your charm's root directory:

.. code-block:: bash
.. terminal::

ls

.. terminal::

CONTRIBUTING.md charmcraft.yaml requirements.txt tox.ini
LICENSE microsample-vm_ubuntu-22.04-amd64.charm src
README.md pyproject.toml tests

Optionally, verify that the .charm file is simply a zip file that contains
everything you've packed plus any dependencies:

.. code-block:: bash
.. terminal::

unzip -l microsample-vm_ubuntu-22.04-amd64.charm | { head; tail;}

.. terminal::

Archive: microsample-vm_ubuntu-22.04-amd64.charm
Length Date Time Name
--------- ---------- ----- ----
Expand Down Expand Up @@ -653,12 +647,10 @@ Publish a charm
3. Upload the charm to Charmhub: Use the ``charmcraft upload`` command followed by the
your charm's path. E.g., if you are in the charm's root directory,

.. code-block:: bash
.. terminal::

charmcraft upload my-awesome-charm.charm

.. terminal::

Revision 1 of my-awesome-charm created

..
Expand All @@ -673,13 +665,10 @@ Publish a charm
4. If your charm has associated resources: These are not packed with the rest of the
charm project, so you must upload them explicitly to Charmhub as well. For example:

.. code-block:: bash

charmcraft upload-resource my-awesome-charm someresource
--filepath=/tmp/superdb.bin

.. terminal::

charmcraft upload-resource my-awesome-charm someresource --filepath=/tmp/superdb.bin

Revision 1 created of resource 'someresource' for charm 'my-awesome-charm'

..
Expand All @@ -695,13 +684,10 @@ Publish a charm
target release channel. For a charm that has a resource, also specify the
resource and its revision. E.g.,

.. code-block:: bash

charmcraft release my-awesome-charm --revision=1 --channel=beta
--resource someresource:1

.. terminal::

charmcraft release my-awesome-charm --revision=1 --channel=beta --resource someresource:1

Revision 1 of charm 'my-awesome-charm' released to beta (attaching resources: 'someresource' r1)

..
Expand Down
Loading