什么是凭证?
Jenkins经常与第三方插件如git,docker等交互,需要提供第三方的凭证,比如access token,用户名和密码等
可以使用插件Credentials Binding Plugin来管理这些凭证
jenkins凭证类型
jenkins可以管理以下凭证
Secret text -------- a token such as an API token (e.g. a GitHub personal access token),
Username and password -------- which could be handled as separate components or as a colon separated string in the format username:password (read more about this in Handling credentials),git使用https方式拉取代码时可以使用用户名和密码这种凭证
Secret file --------- which is essentially secret content in a file,
SSH Username with private key -------- an SSH public/private key pair,
Certificate - --------a PKCS#12 certificate file and optional password, or
Docker Host Certificate Authentication credentials.
下面以gitee为例来说明,jenkins如何使用凭证和第三方插件交互
环境准备
(1)Linux安装git
yum -y install gi