有些时候我们让github有新的push的时候主动来触发我们的job,这个时候我们就需要我们的webhook了
首先,如何获取jenkins的 github hook地址:
Manage Jenkins->Configure System->GitHub->Advanced->Specify another hook URL for GitHub configuration
勾选之后是允许你修改,当然也就显示了当前的hook地址
http://docker.503error.com:8080/github-webhook/
然后,我们需要将这个hook的地址放到我们的相应的repo中
找到我们的repo->setting->Webhooks
然后我们添加
这个操作就是说,当有新的push的时候,github会通知jenkins服务器有新的Push了,你该做相应的操作了,当然,我们项目中必须填写相应的repo地址,要不然你又100个job, jenkins也不知道该跑哪个,唯一和SCM不同的是,这次,我们选择的Github hook
然后,我们保存,然后测试就可以了
Latest posts by Zhiming Zhang (see all)
- aws eks node 自动化扩展工具 Karpenter - 8月 10, 2022
- ReplicationController and ReplicaSet in Kubernetes - 12月 20, 2021
- public key fingerprint - 5月 27, 2021