Some checks failed
Anthrove/Otter-Space-SDK/pipeline/head There was a failure building this commit
38 lines
1.1 KiB
Groovy
38 lines
1.1 KiB
Groovy
pipeline {
|
|
agent {
|
|
docker { image 'docker:dind' }
|
|
}
|
|
tools {
|
|
dockerTool 'Docker'
|
|
}
|
|
stages {
|
|
stage('Checkout') {
|
|
steps {
|
|
checkout scm
|
|
}
|
|
}
|
|
stage('Go Test') {
|
|
agent {
|
|
docker { image 'golang:1.22-alpine' }
|
|
}
|
|
steps {
|
|
sh 'go test -v ./... -json -coverprofile=coverage.out | tee test-report.out'
|
|
}
|
|
}
|
|
stage('SonarQube Analysis') {
|
|
agent {
|
|
docker { image 'amazoncorretto:22-alpine' }
|
|
}
|
|
steps {
|
|
script {
|
|
def scannerHome = tool 'SonarScanner'
|
|
withSonarQubeEnv() {
|
|
sh "${scannerHome}/bin/sonar-scanner -Dsonar.coverageReportPaths=coverage.out -Dsonar.testExecutionReportPaths=test-report.out -Dsonar.branch.name=${env.BRANCH_NAME} -Dsonar.pullrequest.key=${env.CHANGE_ID} -Dsonar.pullrequest.branch=${env.BRANCH_NAME} -Dsonar.pullrequest.base=${env.CHANGE_TARGET}"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|