MultiBranch pipeline github webhook

2019-08-29 05:15发布

Title pretty much says it all. I've seen these:

How to trigger Multibranch Pipeline build with github webhook
https://support.cloudbees.com/hc/en-us/articles/224543927-GitHub-webhook-configuration
https://support.cloudbees.com/hc/en-us/articles/115003019232-GitHub-Webhook-Pipeline-Multibranch

I have a github server setup in jenkins, but cannot choose it in the multibranch source (as one of the links suggests), it asks for credentials but no credentials are in the dropdown.

I've also setup a github webhook, but I dont think it makes any difference

2条回答
可以哭但决不认输i
2楼-- · 2019-08-29 05:53

So, you need just add(create) this credentials in order to be able choose them in dropdown. It could be API key or SSH key. One of your links includes the manual how generate API key:

You need Credentials for each of the GitHub/GitHub Enterprise Server added here. Jenkins needs a Personal API token to interact with the GitHub via webhooks. This token can be either created manually or automatically (see next section). Credentials from User: Admin permissions are required at the repository level but Owner role is required to create it at Organization level; For updating commit statuses / reading the list of collaborators, Write permission is required. You can find more information on the GitHub token permissions in GitHub Permissions and API token Scopes for Jenkins.

Setting up the Credentials As explained in the previous section, the plugin needs a token to work. You can choose to let Jenkins create the token on your behalf, or create it manually.

Let Jenkins create the token: this option is only available if you are not using two-factor authentication. You can make Jenkins generate the token by going to Advanced > Manage Additional GitHub Actions > Convert Login and Password to token.

Generate the token yourself: first generate a token (make sure to read the previous section to understand what rights to grant). Then in the Credentials section (under the API URL) create a Credential of type Secret Text and put the token you generated as a secret text.

You can find more information on the GitHub token permissions here: https://support.cloudbees.com/hc/en-us/articles/234710368-GitHub-User-Scopes-and-Organization-Permission

I hope it will help you.

查看更多
姐就是有狂的资本
3楼-- · 2019-08-29 06:01

I needed to create credentials with username equals to username and password equals to the github token

查看更多
登录 后发表回答