Admin
入口: 首页 - Manage Jenkins - Manage Plugins
页面内:
提供远程部署能力
搜索 - 安装 - 重启服务
首页 - Manage Jenkins - Configure System - Publish over SSH - Add
可以添加适用于所有服务器的私钥(密码)
注意:
~/.ssh/id_rsa
不是公钥 ~/.ssh/id_rsa.pub
~/.ssh/id_rsa
不是公钥 ~/.ssh/id_rsa.pub
~/.ssh/id_rsa
不是公钥 ~/.ssh/id_rsa.pub
首页 - New Item - Freestyle Project - 输入名称 - OK
Build - Add Build Step - Send files or execute commands over ssh
Name - 选择服务器
Exec command - 输入需要执行的命令
当 gogs
中代码操作(push等)时,触发任务
替代太久没更新不能用的 gitlab hook plugin
当 gitlab
中代码操作(push等)时,触发任务
插件还有很多高级功能,暂时没研究
Jenkins - 项目 - Configure - Build Triggers - Build when a change is pushed to GitLab … - Advance - Secret token - Generate
Gitlab - 项目 - Setting - Webhooks
Project Hooks - 找到新建的
返回Jenkins,查看效果
钉钉机器人,状态通知