Skip to content

Commit

Permalink
fix: update docs for metadata external (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
d2lam authored and tkyi committed Dec 4, 2017
1 parent da579f1 commit fe2f5e3
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions docs/user-guide/configuration/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@ toc:

## What is Metadata?

Metadata is a structured key/value storage of relevant information about a [build](../../about/appendix/domain#build). Metadata will be shared with subsequent builds in the same [workflow](../../about/appendix/domain#workflow). It can be updated or retrieved throughout the build by using the built-in [meta CLI](https://github.com/screwdriver-cd/meta-cli) in the [steps](../../about/appendix/domain#step).
Metadata is a structured key/value storage of relevant information about a [build](../../about/appendix/domain#build). It can be updated or retrieved throughout the build by using the built-in [meta CLI](https://github.com/screwdriver-cd/meta-cli) in the [steps](../../about/appendix/domain#step).

## Manipulating Metadata

Screwdriver provides the shell command `meta get` to extract information from the meta store and `meta set` to save information to the meta store.

Example:
### Same pipeline

Screwdriver build can retrieve metadata set by itself or by the previous builds within the same pipeline.

Example: `build1` -> `build2` -> `build3`

`build2`'s metadata will consist of metadata set by itself and `build1`

`build3`'s metadata will consist of metadata from `build2` (which also includes metadata from `build1`)

```bash
$ meta set example.coverage 99.95
$ meta get example.coverage
Expand All @@ -36,3 +45,15 @@ $ meta set foo[2].bar[1] baz
$ meta get foo
[null,null,{"bar":[null,"baz"]}]
```

### External pipeline

Screwdriver build can also access metadata set by an external job which triggers it.

Example: `sd@123:publish` -> `build1`. Then inside `build1`:
```
$ meta get example --external sd@123:publish
{"coverage":99.95}
```

Notes: `meta set` is not allowed for external builds.

0 comments on commit fe2f5e3

Please sign in to comment.