I am trying to set up a Jenkins Blue Ocean pipeline to auto-build my github repo on a PR merge.
I've installed the Go plugins for Jenkins and created the following Jenkinsfile
with the help of Blue Ocean. Just wanted it to be very simple at first - I have a shell script to run that will build the program I just need Jenkins to run it on merge.
pipeline {
agent any
stages {
stage('Building Backend') {
agent any
steps {
echo 'Using Go 1.12'
tool(name: 'Go 1.12', type: 'go')
echo 'Building Backend...'
sh 'go version'
}
}
}
}
The above Jenkinsfile returns
go: command not found
script returned exit code 127
but ideally I want it to recognize Go since I will be running a log of go build
commands. I added Go as a tool in global tool configuration
in the settings of Jenkins.