jenkins - 未找到“Jenkinsfile”

标签 jenkins jenkins-pipeline

我尝试使用 Jenkinsfile 来执行 build.ps1 文件。但是,当我扫描 multibranch-pipeline 时,我看到 Does not meet criteria 日志。为什么 Jenkins 找不到文件。我的仓库地址是 this .

Jenkins 版本:2.138.3

Jenkinsfile 是:

#!groovy

node {
  stage ('Checkout') {
    checkout scm
  }

  stage('Check Env Parameters'){
    echo "Branch Name : ${env.GIT_BRANCH}"
    echo "Octo Server Address : ${env.octoServer}"
  }

  stage('Run Cake') {
    powershell -File build.ps1 -projectName="Jenkins_PowerShell_Cake_Tutorial" -branchName=${env.GIT_BRANCH} -octoServer=${env.octoServer} -octoApiKey=${env.octoApiKey}
  }
}

Jenkinsfile 的类型不是 txt

Jenkinsfile file type screenshoot

詹金日志:

Jenkins Log

Jenkins 配置: project configuration

最佳答案

存储库中的 Jenkinsfile 名为 .Jenkinsfile(以点作为第一个字符)。重命名文件或使用点配置脚本路径。

关于jenkins - 未找到“Jenkinsfile”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53360054/

相关文章:

jenkins - 如何静态检查使用共享库的 Jenkins 管道的代码?

jenkins - 访问在以前的 Jenkins 构建中哪个阶段失败

git - 在 centos : problems with ssh keys and git 上设置 Jenkins

jenkins - 如何在 Jenkins 中使用作业导入插件?

linux - Jenkins:在 bash 脚本中插入特殊字符

jenkins - 用户无法在 API 组中获取资源 "services"- Jenkins 管道 EKS 部署

jenkins - 如何强制 Jenkins 重新加载 Jenkins 文件?

jenkins - 如何在 Jenkins 管道中执行托管脚本

bash - 仅更改一条管道的 Jenkins shell

Jenkins 工作流程(管道)- 仅在 SCM 发生更改时构建作业