You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

45 lines
1.2 KiB

#!/usr/bin/env groovy
node {
def root = tool name: 'System Go', type: 'go'
def gopath = env.WORKSPACE
ws("${gopath}/src/git.wegmueller.it/opencloud/opencloud"){
cleanWs(notFailBuild: true)
withEnv(["GOROOT=${root}", "GOPATH=${gopath}"]) {
env.PATH = "${gopath}/bin:${root}/bin:${env.PATH}"
stage('Checkout') {
checkout scm
}
stage('preTest'){
sh 'mkdir output'
sh 'go version'
sh 'go get github.com/jstemmer/go-junit-report'
sh 'go get -d ./...'
}
stage('Test'){
sh 'go vet'
sh 'go test -v ./... | go-junit-report > report.xml'
junit testResults: 'report.xml'
sh 'go test ./... -cover'
}
stage('Build'){
sh 'go build -o output/imageadm cmd/imageadm.go'
sh 'cp samples/* output'
}
stage("Archive build output"){
archiveArtifacts artifacts: 'output/**'
}
stage('Deploy'){
// Do nothing.
}
}
}
}