xorpaul / g10k

my r10k fork in Go
Apache License 2.0
125 stars 50 forks source link

add branch filtering #167

Closed xorpaul closed 4 years ago

xorpaul commented 4 years ago

added source settings in the g10k config yaml to filter out Puppet environments / control repository branches based on generic commands via filter_command or simply via Golang compatible regex filter_regex

Examples:

==> tests/TestConfigFullworkingBranchFilter.yaml <==
---
:cachedir: '/tmp/g10k'

sources:
  full:
    remote: 'https://github.com/xorpaul/g10k-fullworking-env.git'
    basedir: '/tmp/branchfilter'
    filter_command: 'tests/branch_filter_command.sh $R10K_BRANCH ^(single|master)$'
==> tests/TestConfigFullworkingBranchFilterRegex.yaml <==
---
:cachedir: '/tmp/g10k'

sources:
  full:
    remote: 'https://github.com/xorpaul/g10k-fullworking-env.git'
    basedir: '/tmp/branchfilter'
    filter_regex: '^(single|master)$'