34 lines
778 B
Plaintext
34 lines
778 B
Plaintext
|
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 > test-report.out'
|
||
|
}
|
||
|
}
|
||
|
stage('SonarQube Analysis') {
|
||
|
agent {
|
||
|
docker { image 'amazoncorretto:22-alpine' }
|
||
|
}
|
||
|
def scannerHome = tool 'SonarScanner'
|
||
|
withSonarQubeEnv() {
|
||
|
sh "${scannerHome}/bin/sonar-scanner"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|