duanba8070 2018-11-25 11:43
浏览 239

Golang将Jenkins与Dep结合使用

I use the following code to install dep on jenkins

withEnv(["GOPATH=${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}"]) {
     checkout scm
     sh "go version"
     sh 'wget https://raw.githubusercontent.com/golang/dep/master/install.sh'
     sh 'sh ./install.sh'
     sh "dep ensure"

I see in the log that it copy the bin but when it comes to command dep ensure we got error that dep not found, how to overcome this ?

13:33:41 Fetching https://github.com/golang/dep/releases/latest..
13:33:42 Release Tag = v0.5.0
13:33:42 Fetching https://github.com/golang/dep/releases/tag/v0.5.0..
13:33:42 Fetching https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64..
13:33:51 Setting executable permissions.
13:33:51 Moving executable to /var/jenkins_home/jobs/go-voter/test/builds/22/bin/dep
[Pipeline] sh
13:33:53 + dep ensure
13:33:53 /home/jenkins/workspace/go-voter_test@tmp/durable-16613f28/script.sh: 1: /home/jenkins/workspace/go-voter_test@tmp/durable-

16613f28/script.sh: dep: not found

As written in the log I see that the tool were installed in the bin 22/bin/dep, is it related somehow to the path ? if so, how should I configure it in jenkins ?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog