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 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码