Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocorrecting environment naming #81

Closed
baurmatt opened this issue Nov 20, 2017 · 2 comments
Closed

Autocorrecting environment naming #81

baurmatt opened this issue Nov 20, 2017 · 2 comments

Comments

@baurmatt
Copy link

r10k has this super useful feature to auto correcting environment names.

This is especially helpful if the branches naming follows the bug tracker (e.g. Jira/Youtrack/...) as they tend to be something like [A-Za-z]+-[0-9]+

Could this feature be please added to g10k? :)

@baurmatt
Copy link
Author

Thanks @xorpaul! :)

xorpaul added a commit that referenced this issue May 17, 2018
xorpaul added a commit that referenced this issue May 17, 2018
@xorpaul
Copy link
Owner

xorpaul commented May 17, 2018

Your welcome! :)

Please note that the default value is to leave the environment unchanged, which differs from the r10k default! So you would have to set the g10k config setting invalid_branches to one of the following values:

  • correct_and_warn: Non-word characters will be replaced with underscores and a warning will be emitted.
  • correct: Non-word characters will silently be replaced with underscores.
  • error: Branches with non-word characters will be ignored and an error will be emitted.

Like in r10k

Example:

---
:cachedir: '/tmp/g10k'

sources:
  example:
    remote: 'https://github.com/xorpaul/g10k-environment.git'
    basedir: '/tmp/example/'
    invalid_branches: 'correct'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants