Merge pull request #3147 from LinuxSuRen/fix/default-jenkinsfile
Fix panic against with pipeline-multibranch-defaults-plugin
This commit is contained in:
@@ -902,7 +902,12 @@ func parseMultiBranchPipelineConfigXml(config string) (*devopsv1alpha3.MultiBran
|
||||
}
|
||||
}
|
||||
|
||||
pipeline.ScriptPath = project.SelectElement("factory").SelectElement("scriptPath").Text()
|
||||
scriptPathEle := project.SelectElement("factory").SelectElement("scriptPath")
|
||||
if scriptPathEle != nil {
|
||||
// There's no script path if current pipeline using a default Jenkinsfile
|
||||
// see also https://github.com/jenkinsci/pipeline-multibranch-defaults-plugin
|
||||
pipeline.ScriptPath = scriptPathEle.Text()
|
||||
}
|
||||
return pipeline, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user