Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cmd/kosli/assertArtifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import (
"github.com/spf13/cobra"
)

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

const assertArtifactLongDesc = assertArtifactShortDesc + `
Exits with non-zero code if the artifact has a non-compliant status.`
Expand All @@ -26,6 +27,13 @@ kosli assert artifact \
--api-token yourAPIToken \
--org yourOrgName
# assert that an artifact meets a set of policies
kosli assert artifact \
--fingerprint 184c799cd551dd1d8d5c5f9a5d593b2e931f5e36122ee5c793c1d08a19839cc0 \
--policy has-approval,has-been-integration-tested \
--api-token yourAPIToken \
--org yourOrgName
# fail if an artifact has a non-compliant status (using the artifact fingerprint)
kosli assert artifact \
--fingerprint 184c799cd551dd1d8d5c5f9a5d593b2e931f5e36122ee5c793c1d08a19839cc0 \
Expand Down
5 changes: 5 additions & 0 deletions docs.kosli.com/content/getting_started/policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,8 @@ Regardless of where you place your policy enforcement gate, it will be using the
```shell {.command}
kosli assert artifact --fingerprint=$SHA256 --environment=aws-production
```

An artifact can also be asserted directly against one or more policies.
```shell {.command}
kosli assert artifact --fingerprint=$SHA256 --policy=has-approval,has-been-integration-tested
```