-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathJenkinsfile
27 lines (21 loc) · 856 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
node {
def root = tool name: 'Go1.8', 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 'Checkout'
git url: 'https://github.com/grugrut/golang-ci-jenkins-pipeline.git'
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.
}
}
}