Skip to content

Compute a chart's digest ​

Your chart needs source.sha256, the digest of its folder, and you want the exact value the store will compute.

Solution ​

Run alta package on the chart's folder. For the example data chart saved as my-chart/:

Terminal
sh
alta package my-chart
Output
text
packaged 2 files into …/my-chart.alta.tar (4608 bytes)
  archive sha256: cdb3bb4f53667b894e8f3003ad27a6831b62398a1c118f1113bf8697f2feb52e
  tree digest (the source.sha256 of a chart): e8e0077522bddce6c1a76fb68fecf15c8a7654fd669c2627855ff7f0a73771a3
  source block (the commit and the address come from `alta publish`):
    {
      "git": "https://<your repository>",
      "commit": "<full commit of the push>",
      "sha256": "e8e0077522bddce6c1a76fb68fecf15c8a7654fd669c2627855ff7f0a73771a3"
    }

Copy the tree digest into source.sha256.

How it works ​

alta package checks the folder first and stops on a problem. Then it computes two values. The tree digest covers the path and the bytes of every file, in a fixed order, so it changes when any file changes and never depends on dates, permissions or the machine: it is the value the store recomputes after cloning your repository, and a chart whose files differ is refused. The archive sha256 is the digest of the .alta.tar file written next to the folder, for when you share the archive itself.

Variants ​

  • For a script. alta package my-chart --json prints the same values as JSON.
  • Elsewhere. --out dist/my-chart.alta.tar writes the archive where you want it.
  • The whole source block. The digest of the folder as committed, with the address and the commit, comes from alta publish: see Pin a commit and fill source.

What's next

Alta OS is open source (MIT).