Open Enteee opened 6 years ago
I don't think I understand how this would work. Do you mean all the values here would have slug versions?
Are there any in particular that you think would be used as a slug? Is it primarily the env
variables?
Maybe I should explain my use case for this.
I am currently using something like:
image=image:
[...]
tags: [
"{git.branch}"
]
which fails when users decide to create a branch with a non docker compatible name. For example: feature/awesome-thing
, which is not an uncommon branch name.
image=image:
[...]
tags: [
"{slug(git.branch)}"
]
or
image=image:
[...]
tags: [
"{git.branch.slug}"
]
should convert feature/awesome-thing
to feature-awesome-thing
. According to slug rules.
Cool, that makes sense. I think this would be a cool feature. Maybe something like {git.branch|slug}
, which is similar to some other template languages I've seen. The only prefix that could contain a |
would be time
, but I think that's unlikely.
Gitlab defines for some of their variables a SLUG version:
from GitLab CI/CD Variables (example):
This is super useful when using those variables in combination with docker images names and tags.
dobi
should provide a SLUG version for all it's config variables.