dongxin8709 2019-09-03 20:34
浏览 395

使用Jenkins Blue Ocean找不到命令

I am trying to set up a Jenkins Blue Ocean pipeline to auto-build my github repo on a PR merge.

I've installed the Go plugins for Jenkins and created the following Jenkinsfile with the help of Blue Ocean. Just wanted it to be very simple at first - I have a shell script to run that will build the program I just need Jenkins to run it on merge.

pipeline {
  agent any
  stages {
    stage('Building Backend') {
      agent any
      steps {
        echo 'Using Go 1.12'
        tool(name: 'Go 1.12', type: 'go')
        echo 'Building Backend...'
        sh 'go version'
      }
    }
  }
}

The above Jenkinsfile returns

go: command not found
script returned exit code 127

but ideally I want it to recognize Go since I will be running a log of go build commands. I added Go as a tool in global tool configuration in the settings of Jenkins.

  • 写回答

2条回答 默认 最新

  • duanjian9148 2019-09-04 00:14
    关注

    You can try to execute below command to figure out whether go CLL does exist:

    sh 'which go'
    
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器