Skip to content

Commit 0bf92fb

Browse files
authored
Added some more info about fingerprint of directories and exclude files (#401)
1 parent cc73510 commit 0bf92fb

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

cmd/kosli/fingerprint.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ const fingerprintShortDesc = `Calculate the SHA256 fingerprint of an artifact.`
1010

1111
const fingerprintDirSynopsis = `When fingerprinting a 'dir' artifact, you can exclude certain paths from fingerprint calculation
1212
using the ^--exclude^ flag.
13-
Excluded paths are relative to the DIR-PATH and can be literal paths or
14-
glob patterns.
13+
Excluded paths are relative to the DIR-PATH and can be literal paths or glob patterns.
14+
With a directory structure like this ^foo/bar/zam/file.txt^ if you are calculating the fingerprint of ^foo/bar^ you need to
15+
exclude ^zam/file.txt^ which is relative to the DIR-PATH.
1516
The supported glob pattern syntax is what is documented here: https://pkg.go.dev/path/filepath#Match ,
1617
plus the ability to use recursive globs "**"
1718
@@ -34,9 +35,16 @@ kosli fingerprint --artifact-type file file.txt
3435
# fingerprint a dir
3536
kosli fingerprint --artifact-type dir mydir
3637
37-
# fingerprint a dir while excluding paths
38+
# fingerprint a dir while excluding paths ^mydir/logs^ and ^mydir/*exe^
3839
kosli fingerprint --artifact-type dir --exclude logs --exclude *.exe mydir
3940
41+
# fingerprint a dir while excluding all ^.pyc^ files
42+
kosli fingerprint --artifact-type dir --exclude **/*.pyc mydir
43+
44+
# fingerprint a dir while excluding paths in .kosli_ignore file
45+
echo bar/file.txt > mydir/.kosli_ignore
46+
kosli fingerprint --artifact-type dir mydir
47+
4048
# fingerprint a locally available docker image (requires docker daemon running)
4149
kosli fingerprint --artifact-type docker nginx:latest
4250

cmd/kosli/snapshotAzureApps.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ kosli snapshot azure yourEnvironmentName \
3737
--digests-source logs \
3838
--api-token yourAPIToken \
3939
--org yourOrgName
40+
41+
# Report digest of an Azure Function app
42+
kosli snapshot azure yourEnvironmentName \
43+
--azure-client-id yourAzureClientID \
44+
--azure-client-secret yourAzureClientSecret \
45+
--azure-tenant-id yourAzureTenantID \
46+
--azure-subscription-id yourAzureSubscriptionID \
47+
--azure-resource-group-name yourAzureResourceGroupName \
48+
--api-token yourAPIToken \
49+
--org yourOrgName
4050
`
4151

4252
type snapshotAzureAppsOptions struct {

0 commit comments

Comments
 (0)