I would like to run a python file from jenkinsfile.build pipeline file my jenkinsfile.build file has many stages and from one stage i would like to run a python script the format of my jenkinsfile.build is
stages{
stage('Build stage') {
steps {
echo "${username}"
dir("py_scripts"){
python -u say_hello.py --name '${username}'
}
}
}
stage('Deploy stage') {
--------some code-------
}
}
}
and i have my python code which accepts an argument --name. That is running completely fine. when i Run the jenkins job, i am seeing i get the error in console output of jenkins which denotes the line where i am calling the python script. the error is
18:48:52 WorkflowScript: 26: expecting '}', found 'say_hello' @ line 26, column 31.
18:48:52 python -u say_hello.py --name '${username}'
18:48:52 ^
18:48:52
18:48:52 1 error
i need to change the command i am using to call the python script in jenkinsfile. please help me in this. I am new to this Jenkinsfile.