---
title: Codetree Collect Info
description: We recently landed a feature in Codetree that I’m pretty excited about.
  Codetree is a tool for collecting code from various locations and assembling it
  in a specific directory structure. It can be used in a standalone fashion, but is
  also tightly integrated with Mojo, which we use to deploy and manage Juju models.
  To  […]
url: https://canonical-com-2950.demos.haus/blog/codetree-collect-info?format=md
---

1. [Blog](https://canonical-com-2950.demos.haus/blog)
2. Article

---

[Tom Haddon](https://canonical-com-2950.demos.haus/blog/author/mthaddon "More about Tom Haddon")

15 November 2017

# Codetree Collect Info

---

Share the article

We recently landed a feature in [Codetree](https://launchpad.net/codetree) that I’m pretty excited about. Codetree is a tool for collecting code from various locations and assembling it in a specific directory structure. It can be used in a standalone fashion, but is also tightly integrated with [Mojo](https://mojo.canonical.com/), which we use to deploy and manage [Juju](https://jujucharms.com/) models.

To install Codetree, just run “`sudo snap install codetree --classic`“.

As an example, let’s say you want to get a subset of the latest OpenStack charms. You could do so by creating a file called openstack-charms with the following contents:

```
charms                   @
charms/cinder            git+https://github.com/openstack/charm-cinder;revno=stable/17.08
charms/glance            git+https://github.com/openstack/charm-glance;revno=stable/17.08
charms/hacluster         git+https://github.com/openstack/charm-hacluster;revno=stable/17.08
charms/heat              git+https://github.com/openstack/charm-heat;revno=stable/17.08
charms/keystone          git+https://github.com/openstack/charm-keystone;revno=stable/17.08
```

You’d then run “`codetree openstack-charms`” and you’d have the charms assembled in a “`charms`” directory. So far so good.

But what happens three months from now when you want to upgrade the charms you’ve deployed to a newer version? Or two months from now if you come across a bug in the charms and are not sure exactly what version you deployed and when? Juju strips out any dotfiles and dot directories from charms it deploys, so you won’t be able to use git commands to query where the charms on disk in your deployed OpenStack came from.

This is where the new feature we’ve just added to Codetree comes in. Codetree will now inject a file called “`codetree-collect-info.yaml`” into any directory it downloads, and this file will then be queryable later to confirm what version you deployed. This can be done in situ on your deployed OpenStack instance. For example:

```
juju ssh keystone/0 “head -4 /var/lib/juju/agents/unit*/charm/codetree-collect-info.yaml”
collect_date: '2017-11-01 14:32:55.815503'
collect_url: git+https://github.com/openstack/charm-keystone;revno=91490b7daf7511a717f75f62b57fc3f97cc6d740
hashes:
  LICENSE: cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30
```

Now you can easily see the specific revision the charm was collected from, when it was collected, and the hashes allow you to query if any of the files on disk have been changed.

Our next planned step from here is to add a “`charm-report`” phase to Mojo to allow us to query this information with one simple command.

[Get in touch

Interested in running Ubuntu in your organization?](https://ubuntu.com/about/contact-us/form)

## Sign up for our newsletter

Get the latest Canonical news and updates in your inbox.

Work email:

\*I agree to receive information about Canonical's
products and services.

By submitting this form, I confirm that I have read and agree to [Canonical's Privacy Policy](https://canonical-com-2950.demos.haus/legal/dataprivacy).

Sign up

## Share on

---

## Related posts

[### From raw data to intelligent actions: inside our next-gen AI analytics data lake stack](https://canonical-com-2950.demos.haus/blog/inside-our-next-gen-ai-analytics-data-lake-stack)

At Canonical, we believe organisations should be able to unlock the full value of their data without giving up control. That principle is at the heart of our next-generation...

[Rob Gibbon](https://canonical-com-2950.demos.haus/blog/author/robgibbon)

18 September 2026

[### Beyond the 10-year mark: Extending Ubuntu Pro 16.04 LTS security coverage](https://canonical-com-2950.demos.haus/blog/extending-ubuntu-pro-16-04-coverage)

A decade ago, Canonical launched Ubuntu 16.04 LTS (codenamed “Xenial Xerus”). As a Long-Term Support (LTS) release, it comes with 5 years of standard security coverage, which...

[Carlos Bravo](https://canonical-com-2950.demos.haus/blog/author/carlos-bravo)

17 September 2026

[### Network disaggregation in telecommunication transport networks](https://canonical-com-2950.demos.haus/blog/network-disaggregation)

Telecommunications networks have traditionally been built from tightly integrated systems. A router vendor supplies the forwarding hardware, network operating system (NOS),...

[Benjamin Ryzman](https://canonical-com-2950.demos.haus/blog/author/benjaminryzman)

16 September 2026

[### Bring Zenoh to ROS 2 with snaps](https://canonical-com-2950.demos.haus/blog/bring-zenoh-to-ros-2-with-snaps)

ROS 2 gives robotics developers the freedom to choose the middleware that fits their system. As a communication protocol for ROS, Zenoh has gained strong traction. It delivers...

[gbeuzeboc](https://canonical-com-2950.demos.haus/blog/author/gbeuzeboc)

15 September 2026
