adding jenkinsfile
Some checks failed
gitea-deepak/gogmagog/pipeline/head There was a failure building this commit
Some checks failed
gitea-deepak/gogmagog/pipeline/head There was a failure building this commit
This commit is contained in:
47
Jenkinsfile
vendored
Normal file
47
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
pipeline {
|
||||
agent any
|
||||
tools {
|
||||
go 'go-1.15.6'
|
||||
}
|
||||
environment {
|
||||
GO115MODULE = 'on'
|
||||
}
|
||||
stages {
|
||||
stage('Pre Test') {
|
||||
steps {
|
||||
echo 'Installing dependencies'
|
||||
sh 'go version'
|
||||
sh 'go get -u golang.org/x/lint/golint'
|
||||
}
|
||||
}
|
||||
stage('Compile') {
|
||||
steps {
|
||||
sh 'go build'
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
steps {
|
||||
echo 'Running vetting'
|
||||
sh 'go vet .'
|
||||
echo 'Running linting'
|
||||
sh 'golint .'
|
||||
echo 'Running test'
|
||||
sh 'go test -v ./...'
|
||||
}
|
||||
}
|
||||
stage('Code Analysis') {
|
||||
steps {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
emailext body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\n More info at: ${env.BUILD_URL}",
|
||||
recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']],
|
||||
to: "${params.RECIPIENTS}",
|
||||
subject: "Jenkins Build ${currentBuild.currentResult}: Job ${env.JOB_NAME}"
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user