Jenkins Pipeline插件似乎正在跳过命令

时间:2016-11-25 11:56:39

标签: shell jenkins groovy continuous-integration jenkins-pipeline

我有一个Jenkins Pipeline plugin脚本,如下所示:

[Pipeline] stage
[Pipeline] { (check out project)
[Pipeline] echo
test 1
[Pipeline] echo
test 2
[Pipeline] echo
test 3
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
Finished: SUCCESS

构建的输出是:

io.on('login', function(req){
client.emit('response event', { some: 'data' });

从输出和构建时间判断,只执行echo命令。所有其他人都被忽略了似乎没有错误发生。

如何才能执行所有命令?

1 个答案:

答案 0 :(得分:1)

您的脚本成功运行并在

之后按预期工作
  1. node{ }
  2. 围绕它
  3. 使用sh
  4. shell intead 像这样:

    node{
        stage("check out project") {
            sh "pwd"
            echo "test 1"
            git credentialsId: '12341234-1234-1234-1234-123412341234', url: "git@github.com:sendgrid/sendgrid-java.git"
            echo "test 2"
            sh "git --version"
            echo "test 3"
        }
    }