Skip to content

Instantly share code, notes, and snippets.

@facundobatista
Created July 23, 2020 12:43
Show Gist options
  • Select an option

  • Save facundobatista/d666ac06ac3f8efe44130f4f658c8287 to your computer and use it in GitHub Desktop.

Select an option

Save facundobatista/d666ac06ac3f8efe44130f4f658c8287 to your computer and use it in GitHub Desktop.

Using charmcraft to build, upload and release charms

Through this tutorial we'll see the whole process of publishing a charm: building it, uploading it to the store, and releasing it.

For simplicity we start by having a ready-to-build charm. If you want to start from a previous step, please check this other tutorial on how to build a charm using modern tools.

FIXME: build the structure, remember to include a version.txt file!!!!! FIXME: show the structure!!!

Let's do it!

As I said, the first step is building the charm:

charmcraft build
FIXME: cmd line verbatim

As the command indicated, I have my charm binary built:

ls -l charm
FIXME: cmd line verbatim

If this is our first time with this charm, we will need to register this name in the Store:

charmcraft register ALGO
FIXME: cmd line verbatim

[[FIXME: markup this as a "note" All commands to the Store needs for us to be authenticated. This is handled automatically by charmcraft: if the credentials expired or not found a browser page will open for us to authenticate against the Store as we usually do in the web. We can always check how is our authentication status by issuing charmcraft whoami. ]]

If in doubt, we can easily check all our registered names:

charmcraft names
FIXME: cmd line verbatim

Uploading

Now we're ready to upload the binary. As we're in our project's directory the command is very simple (otherwise we would need to use the --charm-file option to specify the binary's location):

charmcraft upload
FIXME: cmd line verbatim

Everytime we upload a new binary for the charm we get a new revision in the Store. We can verify its current status easily:

charmcraft revisions
FIXME: cmd line verbatim

Note that we didn't specify the charm's name: this is because we're in the project's directory, so the name is retrieved automatically; if you want to ask for any other charm you can use the FIXME option.

Now it's time to release!

charmcraft release
FIXME: cmd line verbatim

Finally, we can see the overall status:

charmcraft status
FIXME: cmd line verbatim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment