Skip to content

Commit 3096036

Browse files
authored
docs(dagger): update module readme (#533)
Signed-off-by: Miguel Martinez Trivino <[email protected]>
1 parent 95771f4 commit 3096036

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

extras/dagger/README.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,36 @@
22

33
![dagger-tested-version](https://img.shields.io/badge/dagger%20version-v0.9.10-green)
44

5-
Daggerized version of [Chainloop](https://chainloop.dev) that can be used to attest and collect pieces of evidence from your [Dagger](https://dagger.io/) pipelines.
5+
Daggerized version of [Chainloop](https://docs.chainloop.dev) that can be used to attest and collect pieces of evidence from your [Dagger](https://dagger.io/) pipelines.
66

77
## Prerequisites
88

9-
- This module requires existing familiarity with Chainloop, and its attestation process. Please refer to [this guide](https://docs.chainloop.dev/getting-started/attestation-crafting) to learn more.
9+
- This module requires existing familiarity with Chainloop and its attestation process. Please refer to [this guide](https://docs.chainloop.dev/getting-started/attestation-crafting) to learn more.
1010
- You need a `token` (aka workflow robot account) [previously generated](https://docs.chainloop.dev/getting-started/workflow-definition#robot-account-creation) by your Chainloop administrator.
1111

1212
## Attestation Crafting
1313

1414
The [attestation process](https://docs.chainloop.dev/getting-started/attestation-crafting) starts with its initialization (`attestation-init`), then adding as many materials/pieces of evidence as needed (`attestation-add`), and finally, signing and pushing the attestation to the Chainloop control plane (`attestation-push`).
1515

16-
### Init attestation ([docs](https://docs.chainloop.dev/getting-started/attestation-crafting#initialization))
16+
You can invoke this module in two ways: either from the Dagger CLI `dagger call ...` or from your own Dagger pipeline by importing this module as a dependency.
17+
18+
### Using the Chainloop module in your Dagger pipeline
19+
20+
To use Chainloop in your module, first, you need to add it as a dependency.
21+
22+
```sh
23+
dagger install github.com/chainloop-dev/chainloop/extras/dagger
24+
```
25+
26+
Once done, you'll have access to the Chainloop client via `dag.Chainloop(chainloopToken)` and all attestation methods (init, add, push, reset, status).
27+
28+
You can find a full example of how to integrate attestation crafting in your `Go` pipeline [here](https://github.com/chainloop-dev/integration-demo/blob/main/chainloop-demo/dagger/src/main.go)
29+
30+
### Using the Dagger CLI
31+
32+
The [attestation process](https://docs.chainloop.dev/getting-started/attestation-crafting) starts with its initialization (`attestation-init`), then adding as many materials/pieces of evidence as needed (`attestation-add`), and finally, signing and pushing the attestation to the Chainloop control plane (`attestation-push`).
33+
34+
#### 1 - Init attestation ([docs](https://docs.chainloop.dev/getting-started/attestation-crafting#initialization))
1735

1836
Initialize an attestation using the Chainloop token stored in the `CHAINLOOP_TOKEN` environment variable.
1937

@@ -28,15 +46,15 @@ dagger call -m github.com/chainloop-dev/chainloop/extras/dagger \
2846

2947
The result of this command will be an `attestation-id` that you will use in the next steps.
3048

31-
### Get the status ([docs](https://docs.chainloop.dev/getting-started/attestation-crafting#inspecting-the-crafting-status))
49+
#### 2 - Get the status ([docs](https://docs.chainloop.dev/getting-started/attestation-crafting#inspecting-the-crafting-status))
3250

3351
```sh
3452
dagger call -m github.com/chainloop-dev/chainloop/extras/dagger \
3553
--token env:CHAINLOOP_TOKEN attestation-status \
3654
--attestation-id $ATTESTATION_ID
3755
```
3856

39-
### Add pieces of evidence ([docs](https://docs.chainloop.dev/getting-started/attestation-crafting#adding-materials))
57+
#### 3 - Add pieces of evidence ([docs](https://docs.chainloop.dev/getting-started/attestation-crafting#adding-materials))
4058

4159
You can attest pieces of evidence by providing its material name and its value, either in the form of a path to a file (`--path`) or a raw value (`--value`).
4260

@@ -72,7 +90,7 @@ dagger call -m github.com/chainloop-dev/chainloop/extras/dagger \
7290
--registry-password MY_PAT_TOKEN
7391
```
7492

75-
### Sign and push ([docs](https://docs.chainloop.dev/getting-started/attestation-crafting#encode-sign-and-push-attestation))
93+
#### 4 - Sign and push attestation ([docs](https://docs.chainloop.dev/getting-started/attestation-crafting#encode-sign-and-push-attestation))
7694

7795
Sign and push the attestation using a cosign **key stored in a file** and a passphrase stored in an environment variable.
7896

@@ -88,7 +106,7 @@ dagger call -m github.com/chainloop-dev/chainloop/extras/dagger \
88106

89107
Alternatively, you can also provide the signing key in an environment variable `--signing-key env:MY_COSIGN_KEY`
90108

91-
### Cancel/Fail attestation
109+
#### 5 - Cancel/mark attestation as failed
92110

93111
```sh
94112
dagger call -m github.com/chainloop-dev/chainloop/extras/dagger \
@@ -108,12 +126,3 @@ Chainloop is developed in the open and is constantly improved by our users, cont
108126
- GitHub [Issues](https://github.com/chainloop-dev/chainloop/issues)
109127
- Discord [Community Server](https://discord.gg/f7atkaZact)
110128
- Youtube [Channel](https://www.youtube.com/channel/UCISrWrPyR_AFjIQYmxAyKdg)
111-
112-
## Contributing
113-
114-
Want to get involved? Contributions are welcome.
115-
116-
If you are ready to jump in and test, add code, or help with documentation, please follow the instructions on
117-
our [Contribution](CONTRIBUTING.md) page. At all times, follow our [Code of Conduct](./CODE_OF_CONDUCT.md).
118-
119-
See the [issue tracker](https://github.com/chainloop-dev/chainloop/issues) if you're unsure where to start, especially the [Good first issue](https://github.com/chainloop-dev/chainloop/labels/good%20first%20issue) label.

0 commit comments

Comments
 (0)