2021-03-30 19:42:49 -04:00
|
|
|
pipeline {
|
2021-03-30 21:11:42 -04:00
|
|
|
agent any
|
|
|
|
tools {
|
|
|
|
go 'go1.16'
|
|
|
|
}
|
|
|
|
environment {
|
|
|
|
GO114MODULE = 'on'
|
|
|
|
CGO_ENABLED = 0
|
|
|
|
GOPATH = "${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}"
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Pre Test') {
|
|
|
|
steps {
|
|
|
|
echo 'Installing dependencies'
|
|
|
|
sh 'go version'
|
|
|
|
sh 'go get -u golang.org/x/lint/golint'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build') {
|
|
|
|
steps {
|
|
|
|
echo 'Compiling and building'
|
|
|
|
sh 'go build'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Test') {
|
|
|
|
steps {
|
|
|
|
sh "go test ./... -v"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|