Gitlab support -- running validation step in gitlab #2337
Unanswered
garethjudson
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hey @garethjudson thanks for raising the issue. Could you try passing 0 arguments to flipt validate. It should use the same strategy as flipt does when it selects state files from its source. When we first implemented it, we had arguments and eventually we taught it to perform the same strategy as it performs in the server. You might need an up to date version of Flipt to make that work. It should match files like you have defined. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Wasn't sure where to post but this is what I did to make the validation work in gitlab.
I created a custom container which I installed flipt into, basically, I had some issues with the default container. I'm not sure what was going wrong tbh, but it might be me doing something wrong, or some combination of gitlab and docker magic that I did wrong. But you probably don't need to do that.
The project structure has the feature toggle yml stored in a directory 'toggles' at the root. I put a file per namespace
I created a validation script, which looks like this:
And the .gitlab.yml step looks like:
I had to use find for the validate command, as glob expansion did not work as I expected, and flipt itself doesn't do the expansion.
I figured out that the '**/.yml' was not matching multi-level subdirectories in sh or in bash. I verified by echoing the **/.yml
However I use zsh as my default shell and in that, it does match multi-levels rather than one. So I got different behaviour locally vs in the container.
This is was not the behaviour I expected-- so after playing around I found that using find was much easier.
Hope this is useful for others.
Beta Was this translation helpful? Give feedback.
All reactions