Ath*_*lha 8 linux bash jenkins jenkins-pipeline
我想运行 bash 命令 throw Jenkins 管道,我正在调用一个具有一些 bash 命令的函数,但出现此错误:
Run Code Online (Sandbox Code Playgroud)java.lang.NoSuchMethodError: No such DSL method 'bash' found among steps
这是函数:
def copy_tools(){
Run Code Online (Sandbox Code Playgroud)// tools bash '''#!/bin/bash mkdir X6//CX6 cp ${x6_tools_path} . unzip CX6.zip -d .\\X6 '''}
你能帮忙吗?
Rob*_*les 10
你想用sh,不是bash。您没有直接在代码中运行 bash。您需要运行sh管道步骤,这将运行配置的 shell。
def copy_tools(){
// tools
sh '''#!/bin/bash
mkdir X6//CX6
cp ${x6_tools_path} .
unzip CX6.zip -d .\\X6
'''
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3732 次 |
| 最近记录: |