English
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
- A chart that passes
alta lint: heremorning-brief, from your first chart. - A git repository with a remote in
https://, readable without a password. - For a chart others install:
"privacy": "shareable"(Share an agent) and alocality(Say what your chart needs online).
Commit and push
alta publishonly 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.Terminalshgit add morning-brief git commit -m "Morning brief" git pushGet the source and the pointer
alta publishchecks the folder with the rules ofalta 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.Terminalshalta publish morning-briefOutputtextready 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).Put the source in the chart
Copy the
sourceblock intochart.json, next to"origin": "community". It says where the chart comes from:gitis anhttps://address with no user name or password,committhe full 40-character commit (never a branch, nor a tag alone),sha256the digest. Never writeverified: a community chart that says it is verified is refused.morning-brief/chart.json: sourcejson{ "git": "https://git.example.org/you/my-charts.git", "commit": "367162a590cd8cfe9441453303c8a067a8806788", "sha256": "41ed48cb79cf57bb77603bdfea8319aa34ff8a41096fe668d60a608e327d91bc" }The placeholder warning is gone. Commit and push this change too.
Terminalshalta lint morning-briefOutputtextok morning-brief (chart) 1 checked, 0 errors, 0 warningsOpen 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 digestalta publishprinted. Add it in a pull request. The first time, also addpublishers/<your id>.jsonwith your name and your handle on the host.sources/morning-brief.jsonjson{ "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
| Do | Avoid |
|---|---|
| The full commit, 40 characters | A branch or a tag: they move |
An https:// address anyone can clone | An 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, locality | Expecting a community chart to do more: it never runs code, and never ships scripts |
| Saying in the summary what your chart does | Calling it verified: refused |