Skip to content

Commit e057bfb

Browse files
committed
refactor readme
Signed-off-by: Olivier Vernin <olivier@vernin.me>
1 parent 42f7601 commit e057bfb

File tree

1 file changed

+148
-12
lines changed

1 file changed

+148
-12
lines changed

README.adoc

Lines changed: 148 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,73 @@
11
= README
22

3+
image:https://www.updatecli.io/images/updatecli.png[alt=Updatecli,float="right",align="center",width=200,height=200]
4+
35
link:https://matrix.to/#/#Updatecli_community:gitter.im[image:https://img.shields.io/matrix/updatecli:matrix.org[]]
46
link:https://github.com/updatecli/policies/blob/main/LICENSE[image:https://img.shields.io/github/license/updatecli/policies[GitHub]]
57
link:https://img.shields.io/github/actions/workflow/status/updatecli/policies/validate.yaml?branch=main[image:https://img.shields.io/github/actions/workflow/status/updatecli/policies/validate.yaml?branch=main[GitHub Workflow Status]]
68

79

8-
This repository contains a list of common Updatecli published on ghcr.io/updatecli/policies/**
10+
These repository contains a list of common Updatecli policies that can be used to automate the update of various software components.
11+
These policies are published on `ghcr.io/updatecli/policies` docker registry and can be used directly by Updatecli users.
12+
Policies are designed to be as generic as possible to fit most use cases and can be customized via values files at runtime.
13+
They follow semantic versioning to ensure compatibility and stability.
14+
15+
== Policies
16+
17+
A list of all available policies can be found link:./POLICIES.md[here].
18+
19+
== Quick Start
20+
21+
Pull and inspect a policy manifest:
22+
23+
[source,shell]
24+
----
25+
updatecli manifest show ghcr.io/updatecli/policies/autodiscovery/golang:latest
26+
----
27+
28+
Run a single policy (dry-run):
29+
30+
[source,shell]
31+
----
32+
updatecli diff ghcr.io/updatecli/policies/autodiscovery/golang:latest
33+
----
34+
35+
Apply a single policy:
36+
37+
[source,shell]
38+
----
39+
updatecli apply --config ghcr.io/updatecli/policies/autodiscovery/golang:latest
40+
----
41+
42+
Compose multiple policies using an updatecli-compose file:
43+
44+
* Create `updatecli-compose.yaml` (example below).
45+
* Run:
46+
[source,shell]
47+
----
48+
updatecli compose apply --config ./updatecli-compose.yaml
49+
----
50+
51+
.updatecli-compose.yaml
52+
----
53+
policies:
54+
- policy: "ghcr.io/updatecli/policies/autodiscovery/golang:latest"
55+
- policy: "ghcr.io/updatecli/policies/autodiscovery/npm:latest"
56+
----
57+
58+
Please be aware that each policies comes with its own set of configuration options so please refer to the policy documentation for more information.
59+
You can replace the policy `ghcr.io/updatecli/policies/autodiscovery/all:latest` by any other policy available in this repository.
60+
61+
== Authentication / Registry
62+
63+
Policies are published on `ghcr.io`. Public pulls usually work, but authenticating reduces rate-limiting:
64+
65+
[source,shell]
66+
----
67+
docker login ghcr.io
68+
----
69+
70+
If you need to pull private policies, provide credentials via your container/runtime or via Updatecli's registry auth options.
971

1072
== HOWTO
1173

@@ -23,24 +85,24 @@ Each policies defines in this repository are automatically published on ghcr.io
2385

2486
We can see the content of the policy by running:
2587

26-
updatecli manifest show ghcr.io/updatecli/policies/<a policy name>:latest
88+
updatecli manifest show --config updatecli.d --values values.yaml
2789

2890
**Use**
2991

30-
They are two ways to execute an Updatecli policy, either running one policy or several policies at once.
92+
There are two ways to execute an Updatecli policy, either running one policy or several policies at once.
3193

3294
One policy can be executed by running:
3395

34-
updatecli apply --config ghcr.io/updatecli/policies/<a policy name>:latest
96+
updatecli apply --config ghcr.io/updatecli/policies/<policy-path>:<version>
3597

3698

3799
IMPORTANT: Any values files specified at runtime will override default values setting from the policy bundle
38100

39-
Assuming we have a file named `update-compose.yaml`, multiple policies can be composed and executed by running:
101+
Assuming we have a file named `updatecli-compose.yaml`, multiple policies can be composed and executed by running:
40102

41-
updatecli compose apply
103+
updatecli compose apply --config ./updatecli-compose.yaml
42104

43-
.update-compose.yaml
105+
.updatecli-compose.yaml
44106
```yaml
45107
policies:
46108
- policy: "ghcr.io/updatecli/policies/autodiscovery/golang:latest"
@@ -51,7 +113,80 @@ More information about Updatecli compose feature can be found link:https://www.u
51113

52114
== CONTRIBUTING
53115

54-
Policies can be added by creating a new folder under `updatecli/policies` directory.
116+
Thank you for your interest in contributing to this project.
117+
Here is a none exclusive list of contribution you can do.
118+
119+
=== Documentation
120+
121+
This project would benefit from clearer policy README files. Please improve each policy's README to explain how to use and configure the policy.
122+
123+
To inspect a policy bundle locally (manifest and default values):
124+
125+
[source,shell]
126+
----
127+
# Show the generated manifest (uses files in the policy bundle directory)
128+
updatecli manifest show --config updatecli.d --values values.yaml
129+
130+
# Show the manifest and render a graph (Mermaid)
131+
updatecli manifest show --config updatecli.d --values values.yaml --graph --graph-flavor mermaid
132+
----
133+
134+
Notes:
135+
* `--config updatecli.d` reads policy manifests shipped inside the policy bundle.
136+
* `--values values.yaml` overrides default policy values for local inspection.
137+
138+
When running policies, prefer pinning by version or digest to ensure reproducible runs:
139+
* By tag: `ghcr.io/updatecli/policies/autodiscovery/golang:1.0.0`
140+
* By digest: `ghcr.io/updatecli/policies/autodiscovery/golang@sha256:<digest>`
141+
142+
Authentication:
143+
* Public pulls usually work, but authenticating with GHCR reduces rate limits:
144+
[source,shell]
145+
----
146+
docker login ghcr.io
147+
----
148+
* For private bundles, provide registry credentials to your runtime or via Updatecli's registry auth options.
149+
150+
Publishing:
151+
* Policies in this repository are published automatically by CI when `Policy.yaml` version is bumped.
152+
* See the `Policy.yaml` template below and ensure you update the `version` field for releases.
153+
154+
Policy inspection and usage summary:
155+
* Inspect: `updatecli manifest show --config updatecli.d --values values.yaml`
156+
* Dry-run: `updatecli diff ghcr.io/updatecli/policies/<path>:<version>`
157+
* Apply: `updatecli apply --config ghcr.io/updatecli/policies/<path>:<version>`
158+
159+
Tip: add a short example `values.yaml` in each policy README to help users test quickly.
160+
161+
=== Updating Policy
162+
163+
Before changing an existing policy, open a GitHub issue to discuss the proposed change. Use the issue to explain:
164+
* Motivation and user impact
165+
* Backwards compatibility implications
166+
* Required changes to `Policy.yaml`, `values.yaml`, or `updatecli.d`
167+
* Testing plan (how the change will be validated)
168+
169+
When preparing a PR:
170+
* Bump `Policy.yaml` version for behavioural changes (semantic versioning).
171+
* Update `CHANGELOG.md` and the policy `README.md` with usage and configuration changes.
172+
* Add or update `values.yaml` examples if defaults change.
173+
* Ensure policy validation CI (lint/manifest tests) passes.
174+
175+
PR checklist:
176+
* [ ] Issue opened describing the change (link in PR)
177+
* [ ] `Policy.yaml` version updated when needed
178+
* [ ] `CHANGELOG.md` updated
179+
* [ ] README and example `values.yaml` updated
180+
* [ ] All CI checks pass (policy validation workflow)
181+
182+
Notes:
183+
* Policies are published automatically by CI when `Policy.yaml.version` is updated.
184+
* For large or breaking changes, discuss a migration plan in the issue and notify maintainers.
185+
* For security-related changes, include an explanation and coordinate disclosure with maintainers.
186+
187+
=== New Policy
188+
189+
A new policy can be added by creating a new folder under the `updatecli/policies` directory.
55190
The subfolder path will be used as the policy name.
56191

57192
For example if we want to create a policy named `autodiscovery/golang`, we need to create a folder named `updatecli/policies/autodiscovery/golang`.
@@ -89,12 +224,13 @@ Any change to the policy code must be reflected by a new version. Policies are a
89224

90225
=== Why a monorepo ?
91226

92-
A monorepo is a repository that contains multiple projects. In our case, we have a single repository that contains multiple Updatecli policies.
227+
A monorepo simplifies policy discovery and publishing while we build tooling and CI. We may split later if needed.
93228

94-
We are still in a very early stage and we are not sure yet if we will keep this repository as a monorepo or if we will split it into multiple repositories.
229+
== Thanks to all the contributors ❤️
95230

96-
But it is easier to handle a monorepo than multiple repositories while we build the tooling and the process to manage Updatecli policies.
231+
link:https://github.com/updatecli/policies/graphs/contributors"[image:https://contrib.rocks/image?repo=updatecli/policies[]]
97232

98233
== LINKS
99234

100-
* link:https://www.updatecli.io/docs/core/compose/[here]
235+
* link:https://www.updatecli.io/docs/core/compose/[Updatecli Compose documentation]
236+
* link:./POLICIES.md[Full Policy list]

0 commit comments

Comments
 (0)