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 树莓派与pix飞控通信
    • ¥15 自动转发微信群信息到另外一个微信群
    • ¥15 outlook无法配置成功
    • ¥30 这是哪个作者做的宝宝起名网站
    • ¥60 版本过低apk如何修改可以兼容新的安卓系统
    • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
    • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
    • ¥50 有数据,怎么用matlab求全要素生产率
    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题