有人告诉我如何使用 Jenkins Pipeline 构建 DXL 脚本吗?我正在使用下面的脚本,但是它既不会失败也不会执行脚本来获得所需的输出。下面是我正在使用的管道脚本,我还通过文本文档在脚本中传递了一些输入。输入是脚本应该在其上运行的 DOORS 模块地址。
pipeline {
agent any
environment {
// Get the Jenkins DOORS username & password from the credential repository
userpwd = credentials('jenkinsdoors')
}
stages {
stage('Initialization') {
steps {
dir('.\\reports') {
// This particular script generates a results file.
// Delete the old results files so we know if it worked or not.
bat('del /Q \*')
}
}
}
stage('Run DXL') {
steps {
// Run the command line, passing in the username and password of the Jenkins DOORS account
bat script: '''
C:\\IBM\\Rational\\DOORS\\9.6\\bin\\doors.exe -u "%userpwd_USR%" -P "%userpwd_PSW%" -b \\\\path\\to\\script\\test.dxl
'''
}
}
// stage('Verify') {
// steps {
// script {
// // Check if the results file exists, so we know if the job worked
// if (!fileExists('.\\reports\\JENKINS.LOG')) {
// echo 'JENKINS.LOG was not generated.'
// currentBuild.result = 'FAILURE'
// }
// else {
// // The file exists - dump the contents of the file to the output log
// bat script: 'type .\\reports\\JENKINS.LOG'
// }
// }
// }
// }
}
}
ok,所以你的问题现在应该解决了。下次您可能会开始使用简单的批处理 dxl 脚本 c:emp\sayHello.dxl
进行调查Stream stm = append ("c:\\temp\\hello.txt")
string now = stringOf dateOf intOf today
stm << "Hello on " now "\n"
close stm
看是否