Closed JoshuaSmeda closed 4 years ago
Yeah, I can tell you right off the bat, that I've never heard of this feature before your ticket :wink: https://github.com/EncoreTechnologies/r10k/blob/feature/branch-filtering/doc/dynamic-environments/configuration.mkd#branch_filter Let me have a look how I can implement this in g10k
I can't find your branch_filter
setting in the official r10k documentation anymore.
Did they remove it and possibly replace it with filter_command
?
https://github.com/puppetlabs/r10k/blob/master/doc/dynamic-environments/configuration.mkd#filter_command
You can try this link:
Works for me in incognito mode as well.
On Thu, Jul 23, 2020 at 1:24 PM Andreas Paul notifications@github.com wrote:
I can't find your branch_filter setting in the official r10k documentation anymore.
Did they remove it and possibly replace it with filter_command?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xorpaul/g10k/issues/166#issuecomment-662952917, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJRBWDWUP6TCGXIP7TGPDFTR5AMYNANCNFSM4PEYBHCA .
Yeah, I saw this link, but that is a fork of the official r10k repository in a branch that is multiple years old.
I would rather implement the filter_command
feature https://github.com/puppetlabs/r10k/blob/master/doc/dynamic-environments/configuration.mkd#filter_command
This would seem to achieve the same result you expect:
filter_command: 'echo $R10K_BRANCH | grep -qE "^(develop)$"'
or
filter_command: '[[ $R10K_BRANCH =~ ^(develop)$ ]]'
Right?
You can also simply test it in your shell:
$ echo $R10K_BRANCH | grep -qE "^(develop)$" && echo matched
matched
$ [[ $R10K_BRANCH =~ ^(develop)$ ]] && echo matched
matched
Checkout my examples here: https://github.com/xorpaul/g10k/pull/167
Would that work for you?
I could not get the previous filter commands to work as I would need to reimplement the Bash piping or shell keywords like [[
, but you could use a simple bash wrapper script for this like https://github.com/xorpaul/g10k/blob/add_branch_filtering/tests/branch_filter_command.sh
I can still rename the filter_regex
to the branch_filter
settings name.
Thanks Andreas,
Will check this out and get back to you.
On Tue, 28 Jul 2020, 18:40 Andreas Paul, notifications@github.com wrote:
Checkout my examples here: #167 https://github.com/xorpaul/g10k/pull/167
Would that work for you?
I could not get the previous filter commands to work as I would need to reimplement the Bash piping or shell keywords like [[, but you could use a simple bash wrapper script for this like https://github.com/xorpaul/g10k/blob/add_branch_filtering/tests/branch_filter_command.sh
I can still rename the filter_regex to the branch_filter settings name.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/xorpaul/g10k/issues/166#issuecomment-665147615, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJRBWDXETLWYN55COFRPHILR535QLANCNFSM4PEYBHCA .
I've added the branch filtering stuff to the new release here:
Hello,
Branch filtering within the g10k config file doesn't work as expected:
Using this for reference: https://github.com/EncoreTechnologies/r10k/blob/feature/branch-filtering/doc/dynamic-environments/configuration.mkd
g10k Config File
This would threotically pull only the
develop
branch but it ends up pulling everything.I can get it to work as expected if I pass the
--branch develop
parameter with the g10k command.I unfortunately need this functionality to work since I use multiple branches in one Puppet environment.