Skip to content

Commit b6b14d9

Browse files
authored
Updated kosli assert artifact policy documentation server/#3740 (#551)
* Updated kosli assert artifact policy documentation server/#3740 * Added policy info to short description * a small update
1 parent f6c8f0b commit b6b14d9

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

cmd/kosli/assertArtifact.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import (
1212
"github.com/spf13/cobra"
1313
)
1414

15-
const assertArtifactShortDesc = `Assert the compliance status of an artifact in Kosli (in its flow or against an environment). `
15+
const assertArtifactShortDesc = `Assert the compliance status of an artifact in Kosli ` +
16+
`(in its flow, against an environment or against one or more policies). `
1617

1718
const assertArtifactLongDesc = assertArtifactShortDesc + `
1819
Exits with non-zero code if the artifact has a non-compliant status.`
@@ -26,6 +27,13 @@ kosli assert artifact \
2627
--api-token yourAPIToken \
2728
--org yourOrgName
2829
30+
# assert that an artifact meets a set of policies
31+
kosli assert artifact \
32+
--fingerprint 184c799cd551dd1d8d5c5f9a5d593b2e931f5e36122ee5c793c1d08a19839cc0 \
33+
--policy has-approval,has-been-integration-tested \
34+
--api-token yourAPIToken \
35+
--org yourOrgName
36+
2937
# fail if an artifact has a non-compliant status (using the artifact fingerprint)
3038
kosli assert artifact \
3139
--fingerprint 184c799cd551dd1d8d5c5f9a5d593b2e931f5e36122ee5c793c1d08a19839cc0 \

docs.kosli.com/content/getting_started/policies.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,8 @@ Regardless of where you place your policy enforcement gate, it will be using the
217217
```shell {.command}
218218
kosli assert artifact --fingerprint=$SHA256 --environment=aws-production
219219
```
220+
221+
An artifact can also be asserted directly against one or more policies.
222+
```shell {.command}
223+
kosli assert artifact --fingerprint=$SHA256 --policy=has-approval,has-been-integration-tested
224+
```

0 commit comments

Comments
 (0)