jenkins如何构建github上的代码(ci cd)

jenkins如何同通过SCM定时轮询构建github代码

我当前的centos,安装步骤如下:
1、wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
2、rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
3、yum install -y jenkins
4、启动jenkins 命令:service jenkins start

启动成功后如图
jenkins如何构建github上的代码(ci cd)
然后通过ip+端口访问

http://81.70.13.149:8080/
jenkins如何构建github上的代码(ci cd)
注意:第一次进入的时候需要添加密码,密码路径在
cat /var/lib/jenkins/secrets/initialAdminPassword
jenkins如何构建github上的代码(ci cd)

点击第一个
进入后选择新建一个任务,如图所示
jenkins如何构建github上的代码(ci cd)
点击保存,保存后如图所示
jenkins如何构建github上的代码(ci cd)
jenkins如何构建github上的代码(ci cd)

jenkins如何构建github上的代码(ci cd)
将这个地址粘贴到这里
jenkins如何构建github上的代码(ci cd)
接下来
jenkins如何构建github上的代码(ci cd)
jenkins如何构建github上的代码(ci cd)
jenkins如何构建github上的代码(ci cd)
jenkins如何构建github上的代码(ci cd)
jenkins如何构建github上的代码(ci cd)

点击保存后过一分钟将会看到从github拉取代码
jenkins如何构建github上的代码(ci cd)
jenkins如何构建github上的代码(ci cd)
jenkins如何构建github上的代码(ci cd)
看到了,这个就是jenkins构建的一个流程,小伙伴试试吧