Allow for wildcards in bitbucket file kind
D
Denell Hopkins
Today Port's bitbacket's integration does not support wildcards or blobs in the file kind
The only place that it supports a wild card is in the path, and it will still make us set the filenames array.
We want to be able to support wildcards.
One or more of the following should work:
- glob: '*.yaml'should match all YAML files in the path
- path: values/team/*should match all files in the directory
- Omitting filenamesshould process all files in the specified
Haim Natan
Use case from the customer:
Trying to consume from a folder a bunch of yaml files that represent teams.
Tried several different ways, a couple represented below.
So that I don't have to pass in each file in the filenames, as that can change and not feasible for keeping teams up to date.
- kind: file
selector:
query: >-
(.metadata.path | startswith("values/team/")) and (.metadata.path |
endswith(".yaml"))
files:
path: values/**/*.yaml
repos:
- environment-common
skipParsing: false
port:
entity:
mappings:
identifier: .content.team
title: .content.team
blueprint: '"team"'
properties:
service_owner: .content.service.owner
secret_provider_class: .content.secretProviderClass
email: if .content.email == "" then null else .content.email end
- kind: file
selector:
query: 'true'
files:
path: values/team
filenames:
'*.yaml'
repos:
- environment-common
skipParsing: false
port:
entity:
mappings:
identifier: .content.team
title: .content.team
blueprint: '"team"'
properties:
service_owner: .content.service.owner
secret_provider_class: .content.secretProviderClass
email: if .content.email == "" then null else .content.email end