Jenkins 组织文件夹扫描未检测到存储库
Jenkins Organization Folder scan doesn't detect repositories
Jenkins Scan Organization Folder Log
看起来像这样:
Started by user Obay Abdelagdir
[Thu Dec 31 16:45:21 UTC 2020] Starting organization scan...
[Thu Dec 31 16:45:21 UTC 2020] Updating actions...
Looking up details of my-org-name...
Organization URL: https://github.com/my-org-name
[Thu Dec 31 16:45:22 UTC 2020] Consulting GitHub Organization
Connecting to https://api.github.com using 94421/****** (Github App, necessary for publishing checks)
Looking up repositories of organization my-org-name
0 repositories were processed
[Thu Dec 31 16:45:23 UTC 2020] Finished organization scan. Scan took 1.3 sec
Finished: SUCCESS
Jenkins“Github 组织文件夹”详细信息:
我尝试按照说明 here,但没有将“Github 应用程序”安装到组织(安装在用户身上),我忽略了 Configuration as Code Plugin
节。
Github 应用详情:
“Github 应用程序”由普通 github 用户创建, 并安装在对组织具有所有者权限的用户上。因为没法直接安装到机构上
编辑:我能够将应用程序的所有权转让给组织并安装它,但同样的问题仍然存在。
我的问题:
它在上面的日志中说 0 repositories were processed
。但是我在组织中有一个分支机构,它有一个名为 .jenkinsfile
的文件(是的,我将其添加到“项目识别器”),其内容如下:
pipeline {
stages {
stage('Static Code Analysis') {
parallel {
stage('Pylint') {
agent {
label "pylint"
}
steps {
sh "pylint --exit-zero --load-plugins=pylint_odoo 0-e odoolint --rcfile=./.pylintrc * > pylint.log"
}
}
}
}
}
}
另一个问题是 github 检查不起作用,它在构建日志中给出以下内容:
[GitHub Checks] Failed Publishing GitHub checks: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/my-org-name/my-repo {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#get-a-repository"}
[GitHub Checks] Failed Publishing GitHub checks: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/my-org-name/my-repo {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#get-a-repository"}
Finished: SUCCESS
回答我自己的问题。
组织中必须安装 github 应用程序。
最好的(也许是唯一的)方法如下:
- 使用您的普通用户帐户登录
- 打开组织url、https://github.com/YOUR-ORG-NAME
- 打开
Settings
选项卡,单击 Developer settings
- 在
Developer settings
下应该有两个选项OAuth Apps
和Github Apps
,点击Github Apps
- 然后按照 noramlly 插件文档中的说明进行操作。
- 最后确保在组织中安装该应用程序。
Jenkins Scan Organization Folder Log
看起来像这样:
Started by user Obay Abdelagdir
[Thu Dec 31 16:45:21 UTC 2020] Starting organization scan...
[Thu Dec 31 16:45:21 UTC 2020] Updating actions...
Looking up details of my-org-name...
Organization URL: https://github.com/my-org-name
[Thu Dec 31 16:45:22 UTC 2020] Consulting GitHub Organization
Connecting to https://api.github.com using 94421/****** (Github App, necessary for publishing checks)
Looking up repositories of organization my-org-name
0 repositories were processed
[Thu Dec 31 16:45:23 UTC 2020] Finished organization scan. Scan took 1.3 sec
Finished: SUCCESS
Jenkins“Github 组织文件夹”详细信息:
我尝试按照说明 here,但没有将“Github 应用程序”安装到组织(安装在用户身上),我忽略了 Configuration as Code Plugin
节。
Github 应用详情:
“Github 应用程序”由普通 github 用户创建, 并安装在对组织具有所有者权限的用户上。因为没法直接安装到机构上
编辑:我能够将应用程序的所有权转让给组织并安装它,但同样的问题仍然存在。
我的问题:
它在上面的日志中说 0 repositories were processed
。但是我在组织中有一个分支机构,它有一个名为 .jenkinsfile
的文件(是的,我将其添加到“项目识别器”),其内容如下:
pipeline {
stages {
stage('Static Code Analysis') {
parallel {
stage('Pylint') {
agent {
label "pylint"
}
steps {
sh "pylint --exit-zero --load-plugins=pylint_odoo 0-e odoolint --rcfile=./.pylintrc * > pylint.log"
}
}
}
}
}
}
另一个问题是 github 检查不起作用,它在构建日志中给出以下内容:
[GitHub Checks] Failed Publishing GitHub checks: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/my-org-name/my-repo {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#get-a-repository"}
[GitHub Checks] Failed Publishing GitHub checks: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/my-org-name/my-repo {"message":"Not Found","documentation_url":"https://docs.github.com/rest/reference/repos#get-a-repository"}
Finished: SUCCESS
回答我自己的问题。
组织中必须安装 github 应用程序。 最好的(也许是唯一的)方法如下:
- 使用您的普通用户帐户登录
- 打开组织url、https://github.com/YOUR-ORG-NAME
- 打开
Settings
选项卡,单击Developer settings
- 在
Developer settings
下应该有两个选项OAuth Apps
和Github Apps
,点击Github Apps
- 然后按照 noramlly 插件文档中的说明进行操作。
- 最后确保在组织中安装该应用程序。