jenkins 配置 在gitlab上拉取代码
###
前言
jenkins 服务器配置可以拉取gitlab 代码:
将jenkins服务器(jenkins启动用户下)公钥文件 上传到gitlab进行认证
一、点击"源码管理",选择 git
二、系统管理 --> Global Tool Configuration<为访问git服务添加认证-----------------上图 Credential 中的 add>
三、服务器生成秘钥文件,jenkins添加凭据(jenkins-web免密连接jenkins服务器【jenkins服务器要与gitlab做免密])
jenkins服务器上jenkins启动用户生成密钥对【配置jenkins的凭据时 添加生成的私钥】 查看gitlab服务器root/普通用户下私钥文件(root用户查看) [root@jenkins ~]# ll /home/wx/.ssh/ total 12 -rw------- 1 wx wx 1679 Apr 21 2020 id_rsa -rw-r--r-- 1 wx wx 396 Apr 21 2020 id_rsa.pub -rw-r--r-- 1 wx wx 344 Apr 22 2020 known_hosts [root@jenkins ~]cat /home/wx/.ssh/id_rsa -----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAui8d7QyN62AvjIx95VFSbreFyw/BLRLFqYbSf7s2mxDdJW2p Kmk5V5MYqXt5vkDZ67hAktGB7PQx8oebwEMaVuBc4RNb52LyFTyLrpFLU+DHqLX1 7IyDu3fYETtOSvoF8UdU2xCO98tP6xfCQc5vwKZLvgBiJhAFwNV8FA7pxerSdtTO h5CL4afLDEtAbI8DyEgQQ+ERUk9gqP7i85n8Jxxbea7prpE1mLqr2oAv62arrfL9 HLtFUtSbIlvGioXWDITIece4u066aYkUtOk+4LZac0mc6tmmO5WNmISMFYQipUTq MpVDQ97u1wqBcIrbjmqtfh0kyakuBkjMfZ9XJQIDAQABAoIBAQCbA4GyDQLYVzQf nBVx6VxtrEUsBUj8IyYJeKQoDxJu1wKZGA2Bryw7+s/MxG5fdhU6iiTRWLgJNmOj nz6RPA1hCdqq1vhs1VfjUI6n4HbMNlll4WII+hDv898ksbEFAdgSxCYlYkr2iwNW JGjra1pmFs73OdB+ClcP728oMCZ5ThaNcOkdFuwYd6x4JZ81s7WFYC0TqK412uON zHgmrao3oYjrUj6tZkZE64!@#ki33hhjAkA+qJNMhbeVOB5JWDonwRACt4B7DM2 4Whr6B3jkelSP/lQ7lzDqPa2NTpXVaTreRAfNyZoFWJiimuiEG6r+yhYsI5FCLOu hC2YS5w9AoGBAOfJupajf5/qlWw2kDodllKEbN+szEbM+wPeGPIa34CLPW4zD418 LPoYh9uBHP5I3lSNQ38++PnBW5ulp7l+g35NLfML+AtjtaPIKVB7FF7Cm8leO8Dx a1FQCW/zI2zZR935oX7l3wosFHSRXD7a1/lAfJKALjskKXxGRKV4XRnPAoGBAM2h 4x8kdXe5EWZKb1sjAG2M0BUhdTu6Vdo9S25M+XDMRDBbl+ockiWALkhC+enijq3V mbkns0Np6Go0KF+YJ+DaBjeuWEduXGWD8ydBfZCU3Bypry3YF/brBexlnYxEQ031 mjJ/G7bw0rMsQyKBcwSNZQ3Pc4/uUSGKrqMcziDLAoGAZ23A8Q8sF/PZkVwXp5ck SNYGrxiwXreBGwy0HPSY3wdC9jWarw2!#@(!jfkldjMC4r/WaqVy/B+n/SBCY6ds jaNq6ZVhrdNkbh0XMm55fH9ifMyr5UDVHoeUbnwURrH+O7L0uWdhy2w4BHwIqZOF 5Bcnd47N9d9hh67jW@!kfdjskYEAsONptQhv5CVXSl8Nm6BoZdSTyxmU92Q7JhlE IgYlLVsJ7W9dJw6cyZWS#!9jfdksjklgklmdoPnTDEkB0fnZlBr47j0Tw56z7L+t Ez/K++yRzDZLc2xIcSeLWOewt1ChdRapJnchKCXRmj+hILWqc2gOXeruxgmD0Q6z W60TxDECgYeeWReWI90juPh9oLSuwl//LMm/SqhrKW57usgidkklfGrob4nueyHS DtvJKTnLJTiAn7h/0HpKXsDAjfhjng0jP0DhHXZL9XIwPeml7clle1epLx9Vb5W+ U0ScjyhCGRqvYtRm5u4BsCZUAEeO9K1/HtVYEFMMydJjI0Q3/RQLnuM= -----END RSA PRIVATE KEY-----
四、jenkins使用gitlab拉取代码凭证
###