2_jenkins_git创建创建及项目构建
- 确保jenkins服务正常工作
- 进入WEB界面
- 查看git插件是否正常安装
"管理系统" --> "管理插件"

"可选插件" 然后找到 "Git plugin",由于我这里已经安装了,所以可选框是灰色的

- 新建工程
![]()
认证方式管理,也可以在项目下配置

"Credentials" --> "System" --> "Add Credentials"

"Kind" -> "SSH Username with private key" --> "Username: root" --> " Private Key: Enter directory" --> "ok"
需要注意的是,这里私钥对应的公钥应该在git仓库相应的用户的ssh公钥认证文件(~/.ssh/authorized)里已经添加过,且这个用户对git仓库有读取的权限

添加git仓库

至此,项目就添加完了,至于后续需要其它的构建参数,需要的时候再设置
- 代码构建
"jenkins" --> "project name: Mainweb"
![]()
"立即构建" --> "build history: #4" --> "进度条倒三角" --> "Console Output"

如果可以看到"SUCCESS"字样,则说明构建成功

这里最基本的项目创建及构建就完成了,当然这也是最基本的功能,目前也正在学习中,后续再继续完善。
Yesterday is history.
Tomorrow is a mystery.
But today is a gift.
That is why it's called the present.
The old game: give a wolf a taste, then keep him hungry.
Tomorrow is a mystery.
But today is a gift.
That is why it's called the present.
The old game: give a wolf a taste, then keep him hungry.



浙公网安备 33010602011771号