-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
23 lines (19 loc) · 729 Bytes
/
Copy pathJenkinsfile
File metadata and controls
23 lines (19 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
node {
def root = tool name: 'Go1.19', type: 'go'
ws("${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/src/github.com/grugrut/golang-ci-jenkins-pipeline") {
withEnv(["GOROOT=${root}", "GOPATH=${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/", "PATH+GO=${root}/bin"]) {
env.PATH="${GOPATH}/bin:$PATH"
stage 'preTest'
sh 'go version'
sh 'go get -u github.com/golang/dep/...'
sh 'dep init'
stage 'Test'
sh 'go vet'
sh 'go test -cover'
stage 'Build'
sh 'go build .'
stage 'Deploy'
// Do nothing.
}
}
}