Skip to content

Publish a chart ​

You share a chart from your own git repository. alta publish checks that the commit is pushed and prints two things: the source block that pins your chart to that commit and its digest, and the pointer a charts repository needs to list it. You add the pointer to a charts repository with a pull request; its review decides when people can install it.

Before you begin 10 minutes

  1. Commit and push

    alta publish only reads your repository: it never commits, pushes or fetches. Commit the chart's folder and push it first, so the commit it pins is one anyone can clone.

    Terminal
    sh
    git add morning-brief
    git commit -m "Morning brief"
    git push
  2. Get the source and the pointer

    alta publish checks the folder with the rules of alta lint, checks that it is committed and pushed, and computes the digest of the folder at that commit. It sends nothing: publishing is a dry run in this version.

    Terminal
    sh
    alta publish morning-brief
    Output
    text
    ready to publish (dry run: nothing sent)
      repository: ~/my-charts (folder morning-brief)
      remote: https://git.example.org/you/my-charts.git
      commit: 367162a590cd8cfe9441453303c8a067a8806788 (pushed)
      source:
        {
          "git": "https://git.example.org/you/my-charts.git",
          "commit": "367162a590cd8cfe9441453303c8a067a8806788",
          "sha256": "41ed48cb79cf57bb77603bdfea8319aa34ff8a41096fe668d60a608e327d91bc"
        }
      pointer for a charts repository (sources/morning-brief.json):
        {
          "git": "https://git.example.org/you/my-charts.git",
          "commit": "367162a590cd8cfe9441453303c8a067a8806788",
          "path": "morning-brief",
          "sha256": "41ed48cb79cf57bb77603bdfea8319aa34ff8a41096fe668d60a608e327d91bc"
        }
      1. Nothing was sent: publishing is a dry run in this version.
      2. Put this source in your chart.json (origin "community"); the content is in the folder morning-brief of the repository, commit and push.
      3. When the store imports it, it clones this commit, recomputes the tree digest and refuses any difference.
      4. To list it in a charts repository, open a pull request there that adds sources/morning-brief.json with the pointer above; its review builds the index entry (see https://docs.os.altasystem.ai/reference/advanced/specs/alta-index-0.1).
  3. Put the source in the chart

    Copy the source block into chart.json, next to "origin": "community". It says where the chart comes from: git is an https:// address with no user name or password, commit the full 40-character commit (never a branch, nor a tag alone), sha256 the digest. Never write verified: a community chart that says it is verified is refused.

    morning-brief/chart.json: source
    json
    {
      "git": "https://git.example.org/you/my-charts.git",
      "commit": "367162a590cd8cfe9441453303c8a067a8806788",
      "sha256": "41ed48cb79cf57bb77603bdfea8319aa34ff8a41096fe668d60a608e327d91bc"
    }

    The placeholder warning is gone. Commit and push this change too.

    Terminal
    sh
    alta lint morning-brief
    Output
    text
    ok   morning-brief (chart)
    1 checked, 0 errors, 0 warnings
  4. Open a pull request to a charts repository

    A charts repository lists a chart kept in your repository with a pointer: one file, sources/<chart id>.json, holding the commit and the digest alta publish printed. Add it in a pull request. The first time, also add publishers/<your id>.json with your name and your handle on the host.

    sources/morning-brief.json
    json
    {
      "git": "https://git.example.org/you/my-charts.git",
      "commit": "367162a590cd8cfe9441453303c8a067a8806788",
      "path": "morning-brief",
      "sha256": "41ed48cb79cf57bb77603bdfea8319aa34ff8a41096fe668d60a608e327d91bc"
    }

    The repository's checks clone your commit, recompute the digest and refuse any difference. Then a review sets the chart's status: until it does, the chart is listed but nobody can pull it. See How charts are reviewed.

A new version ​

Change the chart, raise its version, write what changed in changes, commit, push, and run alta publish again: a new commit is a new digest, so it is a new pointer and a new review. A new version that asks for more (a new service, a new sign-in, more permissions) asks the owner again before it installs.

Pitfalls ​

DoAvoid
The full commit, 40 charactersA branch or a tag: they move
An https:// address anyone can cloneAn address with a user name, a password or a token: refused
The same rules as any chart: closed list, a proof for each part, support, localityExpecting a community chart to do more: it never runs code, and never ships scripts
Saying in the summary what your chart doesCalling it verified: refused

What's next

Alta OS is open source (MIT).