如何检查 YML 语法是否正确(gitlab.yml) [英] How to check YML grammar is correct (gitlab.yml)

查看:20
本文介绍了如何检查 YML 语法是否正确(gitlab.yml)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

,它将寻找keys 的差异(不是值,因为您应该将自己的值放在那里)

## LDAP 设置ldap: (<--- 它是一个键)启用:真^^^ ^^^核心价值

我只是做一个:

cd gitlab/configcheck_all_diff .

这样,如果密钥、密钥顺序、新密钥或已删除密钥有任何变化,我可以在升级 gitlab 时发现这些.

总而言之,您需要复制 目录部分你的 $PATH:

别忘了:

GitLab server can't start. The reason is likely because gitlab.yml configuration file is not correct.

What tool to use to check yml grammar is correct?

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

Notepad doesn't like indent for 1 line.

SublimeText

Can really indents and spaces be problem in GitLab config parser?

解决方案

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

  • gitlab.yml
  • gitlab.yml.example

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

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

I just do a:

cd gitlab/config
check_all_diff .

That way, if there are any change in term of keys, key order, new keys or deleted keys, I can spot those when I upgrade gitlab.

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

Don't forget to:

这篇关于如何检查 YML 语法是否正确(gitlab.yml)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆