I want to run bash commands throw Jenkins pipeline, I'm calling a function that has some bash commands but I'm getting this error:
java.lang.NoSuchMethodError: No such DSL method 'bash' found among steps
This is the function:
def copy_tools(){
// tools bash '''#!/bin/bash mkdir X6//CX6 cp ${x6_tools_path} . unzip CX6.zip -d .\\X6 '''}
can you please help?
You want to use sh, not bash. You aren't directly running bash in your code. You need to run the sh pipeline step, which will run the configured shell.
def copy_tools(){
// tools
sh '''#!/bin/bash
mkdir X6//CX6
cp ${x6_tools_path} .
unzip CX6.zip -d .\\X6
'''
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With