0

In Gitlab Omnibus installation, inside the /etc/gitlab/gitlab.rb configuration script, how can I detect the current version of Gitlab? (I need to enable/disable some features depending on version of Gitlab.)

edit: Please note I need this check to work specifically from inside gitlab.rb script! The answers described in How to check the version of Gitlab? are not clearly appropriate for this question out of the box. At least not without some highly non-obvious to me adaptation. If you can demonstrate how any of those applies, please show it explicitly, I can't see such a way myself.

akavel
  • 4,789
  • 1
  • 35
  • 66
  • Possible duplicate of [How to check the version of Gitlab?](https://stackoverflow.com/questions/21068773/how-to-check-the-version-of-gitlab) – Hackerman Jun 06 '18 at 12:51
  • @Hackerman Please note I've edited to explain why https://stackoverflow.com/questions/21068773 is not a duplicate. At least not without some ***highly nonobvious adaptation*** – akavel Jun 06 '18 at 13:07
  • I didnt saw any `version` in gitlab.rb file. You might need to come out of `gitlab.rb` file and do as [this](https://stackoverflow.com/questions/21068773/how-to-check-the-version-of-gitlab) suggests – Rajana Deepak Jun 08 '18 at 07:39
  • @RajanaDeepak `gitlab.rb` is Ruby code, and is loaded by a Ruby script, so it's very much possible, that the loader, being part of Gitlab application, somehow exposes current Gitlab version to `gitlab.rb` code. That would be the perfect solution. Alternatively, maybe some (but not all) answers from "the other question" could be nontrivially adapted as Ruby code that could be used in `gitlab.rb`. – akavel Jun 08 '18 at 10:20

0 Answers0