Golang将Jenkins与Dep结合使用

时间:2018-11-25 11:43:38

标签: go jenkins

我使用以下代码在dep上安装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"

我在日志中看到它复制了垃圾箱,但是 当涉及到命令dep ensure时,我们得到了找不到dep的错误,如何克服呢?

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:部门:未找到

正如日志中所写,我看到该工具已安装在bin 22/bin/dep中, 它与路径相关吗?如果是这样,我应该如何在jenkins中配置它?

0 个答案:

没有答案