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 ?