How to check YML grammar (gitlab.yml)

GitLab server cannot start . The reason is that the gitlab.yml configuration file is incorrect.

What tool can I use to verify yml grammar?

I tried Notepad ++ and SublimeText, but they show a small sign in different places:

Notepad does not like indentation for 1 line. Notepad ++

SublimeText enter image description here

Could there really be indentation and spaces in the GitLab configuration parser?

+4
source share
1 answer

What I use and it works with any editor is a comparison between:

  • gitlab.yml
  • gitlab.yml.example

I developed a little bash diff script that will look for differences in keys (not values, since you have to put your own values)

 ## LDAP setting ldap: (<--- it is a key) enabled: true ^^^ ^^^ key value 

I just do:

 cd gitlab/config check_all_diff . 

So, if there are any changes in terms of keys, order of keys, new keys or deleted keys, I can notice them when updating gitlab.

To summarize, you need to copy to the directory part of your $PATH :

Do not forget:

+1
source

Source: https://habr.com/ru/post/1493102/


All Articles