1.首先登陆控制台点击系统管理

2.进入右侧面板中的系统配置-然后点击插件管理

3.在可选插件里面搜索gitee 找到gitee plugin安装即可,我的这个由于插件已经安装过了所以就显示在了可选的插件里面

安装好之后会自动显示插件已开启

使用自己的用户名和密码登陆Gitee网站
https://gitee.com/ 在右边的下拉菜单中点击设置

在安全设置中找到私人令牌-单击进入

点击生成私人令牌-选择好权限后点击提交


点击验证

记住这串token 点击复制保存下来--后面我们会在Jenkins中使用这个token

至此Gitee上的工作就暂时结束了,让我们再回到Jenkins中来
Jenkins上的操作: 回到控制台主页点击-新建任务

输入任务名称和你想要构建的风格后 点击确定

在源码管理里面填写上你Gtiee仓库需要拉取代码的url,在gitee仓库中的位置如下

从gitee上将仓库的地址复制下来之后填写到Jenkins URL地址的方选框内

身份认证的话填写的填写的是Jenkins在linux服务器上生成的私钥,因为公钥和私钥是一对,公钥我们已经添加到了gitee上,这时候用自己的私钥去访问,就可以成功的访问到gitee仓库了
另外 在Jenkins服务器上通过ssh-keygen生成公私密钥私钥给自己,公钥放到Gitee服务器上,这样在git clone的时候就可以实现免密拉取代码了(如有疑惑者见我前面的文章)
实际操作:点击添加Jenkins凭据

类型选择私钥

填写Username和Passphrase (私钥),填写完毕后点击添加

选择刚刚新建好的凭据


在构建触发器中选择Gitee webhook触发构建


点击生成GiteeWebhook密码,这个密码是要往Gitee上贴的,所i记住下这个密码

构建为了方便就先选择执行shell

这里的就随便写几个linux命令,看看后面能不能执行,写好后-点击应用

让我们回到控制台来手动执行下这个任务看看是否有问题

打开控制台看下

在下拉箭头的菜单中选择-控制台输出

经过对控制台上输出的内容的查看,发现我们写的命令已经被成功执行了

最后一步在Gitee仓库中选择将Jenkins的Webhook字符串配置到Gitee的Webhook中即可

这里的话我要和大家提一些,URL的地址要填写公网的地址,或者有内网穿透工具也可以,由于我的服务器没有在公网所以即使这样写了也是推送也是不成功的,只是把填写的位置和大家阐述了一下,方便大家日后自己填写
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 2 本地部署DeepSeek模型构建本地知识库+联网搜索详细步骤