1
0
Fork 0

Make it so Jenkins can actually build
timw4mail/gilo/pipeline/head There was a failure building this commit Details

This commit is contained in:
Timothy Warren 2021-03-30 21:11:42 -04:00
parent 538bc79cad
commit d251362776
1 changed files with 32 additions and 24 deletions

56
Jenkinsfile vendored
View File

@ -1,25 +1,33 @@
pipeline {
agent {
docker {
image 'golang:latest'
args '--privileged'
}
}
environment {
GO114MODULE = 'on'
CGO_ENABLED = 0
GOPATH = "${JENKINS_HOME}/workspace/${JOB_NAME}/builds/${BUILD_ID}"
}
stages {
stage('Build') {
steps {
sh "go build"
}
}
stage('Test') {
steps {
sh "go test ./... -v"
}
}
}
}
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"
}
}
}
}