Jenkins在读取Bitbucket repo的内容时会看到什么?

bprjcwpo  于 2023-10-17  发布在  Jenkins
关注(0)|答案(1)|浏览(102)

Jenkins安装在本地网络中的本地服务器上。它需要连接到一个Bitbucket服务器示例,该示例也在我们的本地网络中运行。
我们在Jenkins中创建了一个Bitbucket团队/项目,并将其配置为与Bitbucket服务器示例进行联系。当Bitbucket Team/Project在Jenkins中运行时,能够成功连接到Bitbucket Server本地示例中的正确仓库。它能够列出链接的Bitbucket存储库中每个分支的名称。但它找不到Jenkins文件。
我的主要问题是:当Jenkins查找Jenkins文件时,我如何才能知道Jenkins在目录结构中实际看到了什么?知道Jenkins看到了什么将使它更容易弄清楚为配置输入什么语法。
代码从this GitHub repository下载。如您所见,Jenkins文件位于jenkins/Jenkinsfile目录中,尽管Jenkins似乎无法在该位置找到它。当我们将Jenkins配置为在Jenkinsfile而不是在jenkins/Jenkinsfile上查找Jenkins文件时,我们会得到类似的错误。
以下是Bitbucket Team/Project运行时生成的日志:

Started
[Thu Apr 19 22:20:10 GMT 2018] Starting organization scan...
[Thu Apr 19 22:20:10 GMT 2018] Updating actions...
Looking up team details of JPE...
Connecting to http://<local-bitbucket-server-ip>:7990 using CredentialName/******
Team: Jenkins Pipeline Examples
[Thu Apr 19 22:20:10 GMT 2018] Consulting Bitbucket Team/Project
Connecting to http://<local-bitbucket-server-ip>:7990 using CredentialName/******
Looking up repositories of team JPE
Proposing simple-python-pyinstaller-app
Connecting to http://<local-bitbucket-server-ip>:7990 using CredentialName/******
Repository type: Git
Looking up JPE/simple-python-pyinstaller-app for branches
Checking branch py-issue-branch-example from JPE/simple-python-pyinstaller-app
      ‘jenkins/Jenkinsfile’ not found
    Skipped
Checking branch master from JPE/simple-python-pyinstaller-app
      ‘jenkins/Jenkinsfile’ not found
    Skipped
Checking branch feature/py-feature-branch-example from JPE/simple-python-pyinstaller-app
      ‘jenkins/Jenkinsfile’ not found
    Skipped

  3 branches were processed
Looking up JPE/simple-python-pyinstaller-app for pull requests

  0 pull requests were processed
1 repositories were processed
[Thu Apr 19 22:20:10 GMT 2018] Finished organization scan. Scan took 0.21 sec
Finished: SUCCESS
1szpjjfi

1szpjjfi1#

当你去你的Jenkins工作,你应该能够查看工作区。这是它 checkout 存储库的地方,这将向您显示Jenkins“看到”的内容。
Jenkins设置了一个环境变量$WORKSPACE,它是工作区目录的绝对路径。这可以帮助您确保您在搜索文件时处于想要的位置。

相关问题