我無法得到一個shell命令在一個階段來完成我已經定義:管道一步遇到問題解決文件路徑
stages {
stage('E2E Tests') {
steps {
node('Protractor') {
checkout scm
sh '''
npm install
sh 'protractor test/protractor.conf.js --params.underTestUrl http://192.168.132.30:8091'
'''
}
}
}
}
shell命令問題量角器調用,它需要一個配置文件中的說法,但當量角器試圖檢索它時,找不到該文件。
如果我從checkout scm
步驟中查看工作空間目錄中檢出回購庫的位置,我可以看到測試目錄存在,並且存在配置文件sh
步驟正在引用。
所以我不確定爲什麼找不到文件。
我想過要驗證量角器命令發出時可以看到的文件。
因此,像:
stages {
stage('E2E Tests') {
steps {
node('Protractor') {
checkout scm
def files = findFiles(glob: 'test/**/*.conf.js')
sh '''
npm install
sh 'protractor test/protractor.conf.js --params.underTestUrl http://192.168.132.30:8091'
'''
echo """${files[0].name} ${files[0].path} ${files[0].directory} ${files[0].length} ${files[0].lastModified}"""
}
}
}
}
但這並不工作,我不認爲findFiles可以在某個步驟中使用嗎?
任何人都可以提供有關可能會發生什麼的任何建議嗎?
感謝
爲什麼你在'sh'裏面有'sh'? –
我意識到,在發佈問題後不久,我現在感到啞巴! – mindparse