Reputation: 2009
I try to use Jenkinsfile for executing build.ps1 file. However, when I scan multibranch-pipeline, I see Does not meet criteria
log. Why Jenkins cannot find file. My repo url is this.
Jenkins version : 2.138.3
Jenkinsfile is:
#!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's type is not txt
Jenkin Log:
Upvotes: 2
Views: 16672
Reputation: 7739
There is also a bug in Jenkins related to this issue: https://issues.jenkins-ci.org/browse/JENKINS-54126
Upvotes: 0
Reputation: 730
Check Jenkinsfile path if not on the same level provide a relative path. This worked for me.
Upvotes: 0
Reputation: 2683
The Jenkinsfile
in your repo is named .Jenkinsfile
(with a dot as first character). Either rename the file or configure the script path with the dot.
Upvotes: 5