简体   繁体   English

在Jenkins Multibranch Pipeline中访问私有GitHub存储库

[英]Accessing private GitHub repos in Jenkins Multibranch Pipeline

I have Jenkins setup with both SSH and a private token - so it can access a "Git" private repo quite happily, and via the Config screen it can set the hooks. 我有同时使用SSH和专用令牌的Jenkins设置-因此它可以很高兴地访问“ Git”专用存储库,并且可以通过Config屏幕设置钩子。 The pipeline itself works perfectly well outside this issue. 在此问题之外,管道本身运行良好。

My issue is where I want to create a "GitHub" source so that it can support the extra features (including automatic webhook and reporting back), but all the repos are private, so nothing is showing up when trying to add it. 我的问题是我想在其中创建“ GitHub”源,以便它可以支持额外的功能(包括自动webhook和向后报告),但是所有存储库都是私有的,因此在尝试添加它时什么都没有显示。

I have token credentials setup (secret key for Jenkins config, user + pass/token for Branch Sources) - they are setup from a user with full access to the repos (the same user providing ssh access to the "Git" source). 我有令牌凭证设置(Jenkins配置的秘密密钥,用户+分支源的通过/令牌)-它们是由对仓库有完全访问权限的用户(同一用户提供对“ Git”源的ssh访问)设置的。 The token works correctly for the main Jenkins config. 该令牌可在主要的Jenkins配置中正常工作。

Issue: The GitHub source recognises the Owner name correctly, but the Repository dropdown remains stubbornly empty. 问题: GitHub源可以正确识别所有者名称,但是“存储库”下拉列表顽固地为空。

For some reason the token also requires the "user:email" permission to work properly, once this is added then things work. 由于某种原因,令牌还需要“ user:email”权限才能正常工作,一旦添加该令牌,事情就可以进行。 It is significantly easier to add via the Blue Ocean plugin and its wizard however. 但是,通过Blue Ocean插件及其向导进行添加非常容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM