Fix: use sonar-scanner tool from Jenkins
This commit is contained in:
Vendored
+5
-4
@@ -1,5 +1,8 @@
|
||||
pipeline {
|
||||
agent any
|
||||
tools {
|
||||
jdk 'JDK17'
|
||||
}
|
||||
stages {
|
||||
stage('Clone') {
|
||||
steps {
|
||||
@@ -9,6 +12,7 @@ pipeline {
|
||||
stage('SonarQube Analysis') {
|
||||
steps {
|
||||
withSonarQubeEnv('sonarqube') {
|
||||
withEnv(["PATH+SONAR=${tool 'sonar-scanner'}/bin"]) {
|
||||
sh '''
|
||||
sonar-scanner \
|
||||
-Dsonar.projectKey=datalab-lite \
|
||||
@@ -20,6 +24,7 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Quality Gate') {
|
||||
steps {
|
||||
waitForQualityGate abortPipeline: false
|
||||
@@ -28,7 +33,6 @@ pipeline {
|
||||
stage('Deploy') {
|
||||
steps {
|
||||
sh '''
|
||||
# Mettre à jour le ConfigMap code
|
||||
kubectl create configmap datalab-lite-code \
|
||||
--from-file=main.py=main.py \
|
||||
--from-file=k8s.py=k8s.py \
|
||||
@@ -36,15 +40,12 @@ pipeline {
|
||||
-n datalab-lite \
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
# Mettre à jour le ConfigMap templates
|
||||
kubectl create configmap datalab-lite-templates \
|
||||
--from-file=index.html=templates/index.html \
|
||||
-n datalab-lite \
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
# Redémarrer le pod
|
||||
kubectl rollout restart deployment datalab-lite -n datalab-lite
|
||||
|
||||
echo "✅ Datalab Lite déployé"
|
||||
'''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user