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 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类