Jenkinsfile
Opened this issue · 8 comments
cloudscode commented
Jenkinsfile
#31
cloudscode commented
multi-line shell script within Jenkins
stages {
stage('Build') {
steps {
sh 'echo "Hello World"'
sh '''
echo "Multiline shell steps works too"
ls -lah
'''
}
}
}
cloudscode commented
cloudscode commented
cloudscode commented
sudo: sorry, you must have a tty to run sudo
导致这问题的原因是 sudo默认需要在 tty终端里才能正确被调用,我们可以通过修改 /etc/sudoers配置文件来解决这个问题:
vi /etc/sudoers
注释掉 Default requiretty 一行
cloudscode commented
sudo: no tty present and no askpass program specified
在/etc/sudoers配置文件中添加 jenkins ALL=(ALL) NOPASSWD: ALL
vi /etc/sudoers
jenkins ALL=(ALL) NOPASSWD: ALL
cloudscode commented
Unsupported protocol scheme found: 'http://mint-gitlab:2375'. Only 'tcp://' or 'unix://' supported.
http://192.168.2.2:4243/
try
tcp://192.168.2.2:4243/
cloudscode commented