I have a shell script that using "read" command to get user input when execution like followings:
#!/bin/bash
echo please input Version:
read version
However, when I used jenkins pipeline to execute this script, it directly skipped the user input.
pipeline {
agent any
stages {
stage('Build') {
steps {
dir('/tmp'){
sh './Build.sh'
}
}
}
}
}
The jenkins console log:
[Pipeline] sh
+ ./Build.sh
RootPath : /tmp
please input Version:
release version is null.
[Pipeline] }
How could I pass the "input" to this shell script from Jenkins pipeline? Many thanks.