otter-space-sdk/Jenkinsfile

38 lines
981 B
Plaintext
Raw Normal View History

2024-07-19 09:13:30 +00:00
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 {
2024-07-19 09:32:12 +00:00
sh 'go test -v ./... -json -coverprofile=coverage.out | tee test-report.out'
2024-07-19 09:13:30 +00:00
}
}
stage('SonarQube Analysis') {
agent {
docker { image 'amazoncorretto:22-alpine' }
}
2024-07-19 09:16:17 +00:00
steps {
script {
def scannerHome = tool 'SonarScanner'
withSonarQubeEnv() {
sh "${scannerHome}/bin/sonar-scanner -Dsonar.coverageReportPaths=coverage.out -Dsonar.testExecutionReportPaths=test-report.out"
2024-07-19 09:16:17 +00:00
}
}
2024-07-19 09:13:30 +00:00
}
}
}
}