Skip to content

Commit

Permalink
Add docs for .kosli_ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
tooky committed Sep 19, 2024
1 parent b74f681 commit 8ede80d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/kosli/attestArtifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type AttestArtifactPayload struct {
const attestArtifactShortDesc = `Attest an artifact creation to a Kosli flow. `

const attestArtifactLongDesc = attestArtifactShortDesc + `
` + fingerprintDesc + `
` + fingerprintDesc + kosliIgnoreDesc + `
This command requires access to a git repo to associate the artifact to the git commit it is originating from.
You can optionally redact some of the git commit data sent to Kosli using ^--redact-commit-info^`

Expand Down
4 changes: 3 additions & 1 deletion cmd/kosli/fingerprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ using the ^--exclude^ flag.
Excluded paths are relative to the DIR-PATH and can be literal paths or
glob patterns.
The supported glob pattern syntax is what is documented here: https://pkg.go.dev/path/filepath#Match ,
plus the ability to use recursive globs "**"`
plus the ability to use recursive globs "**"
` + kosliIgnoreDesc

const fingerprintLongDesc = fingerprintShortDesc + `
Requires ^--artifact-type^ flag to be set.
Expand Down
3 changes: 3 additions & 0 deletions cmd/kosli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ The service principal needs to have the following permissions:
2) Microsoft.ContainerRegistry/registries/pull/read
`
kosliIgnoreDesc = `To specify paths in a directory artifact that should always be excluded from the SHA256 calculation, you can add a ^.kosli_ignore^ file to the root of the artifact.
Each line should specify a relative path or path glob to be ignored. You can include comments in this file, using ^#^.
The ^.kosli_ignore^ will be treated as part of the artifact like any other file,unless it is explicitly ignored itself.`

// flags
apiTokenFlag = "The Kosli API token."
Expand Down
2 changes: 1 addition & 1 deletion cmd/kosli/snapshotPath.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can exclude certain paths or patterns from the artifact fingerprint using ^-
The supported glob pattern syntax is what is documented here: https://pkg.go.dev/path/filepath#Match ,
plus the ability to use recursive globs "**"
`
` + kosliIgnoreDesc

const snapshotPathExample = `
# report one artifact running in a specific path in a filesystem:
Expand Down
3 changes: 2 additions & 1 deletion cmd/kosli/snapshotPaths.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ glob patterns.
The supported glob pattern syntax is what is documented here: https://pkg.go.dev/path/filepath#Match ,
plus the ability to use recursive globs "**"
` + kosliIgnoreDesc + `
This is an example YAML paths spec file:
` +

"```yaml\n" +
`version: 1
artifacts:
Expand Down

0 comments on commit 8ede80d

Please sign in to comment.