Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
O
odoo-demo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ndoumbe
odoo-demo
Commits
b24294ba
Commit
b24294ba
authored
Jan 01, 2025
by
khadythiara
Browse files
Options
Browse Files
Download
Plain Diff
pull file
Merge branch 'khady' of
https://gitlab.baamtu.com/diopbe/odoo-demo
into khady
parents
f396c221
887f9c36
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
85 deletions
+61
-85
Jenkinsfileargo
Jenkinsfileargo
+51
-75
values.yaml
charts/values.yaml
+10
-10
No files found.
Jenkinsfileargo
View file @
b24294ba
pipeline {
pipeline {
environment {
environment {
imagename = "khadydiagne/k8s_app"
imagename = 'khadydiagne/odoo-app' // Nom de l'image Docker
registryCredential = 'docker'
registryCredential = 'dockerhub' // Identifiants Docker Hub stockés dans Jenkins
SONAR_PROJECT_KEY = 'test_java'
SONAR_HOST_URL = 'http://192.168.230.128:9000'
SONAR_TOKEN = credentials('sonarqube') // Jeton d'accès SonarQube stocké dans Jenkins
KUBECONFIG = '/var/lib/jenkins/.kube/config' // Chemin vers le fichier kubeconfig dans Jenkins
}
}
agent any
agent any
stages {
stages {
stage('Cloning Git') {
stage('Cloning Git') {
steps {
steps {
// Cloner le dépôt Git contenant le Dockerfile et l'application Odoo
git([url: 'https://github.com/khadythiara/test_sonarqube.git', branch: 'main'])
git([url: 'https://github.com/khadythiara/test_sonarqube.git', branch: 'main'])
sh 'chmod +x ./mvnw'
}
}
}
}
stage('Building
Image') {
stage('Building Docker
Image') {
steps {
steps {
script {
script {
// Construire l'image Docker pour l'application Odoo
dockerImage = docker.build(imagename, ".")
dockerImage = docker.build(imagename, ".")
}
}
}
}
}
}
stage('Push
Image') {
stage('Push Docker
Image') {
steps {
steps {
script {
script {
// Pousser l'image Docker vers Docker Hub
docker.withRegistry('', registryCredential) {
docker.withRegistry('', registryCredential) {
dockerImage.push("$BUILD_NUMBER")
dockerImage.push("$BUILD_NUMBER")
dockerImage.push('latest')
dockerImage.push('latest')
...
@@ -38,30 +38,8 @@ pipeline {
...
@@ -38,30 +38,8 @@ pipeline {
stage('ArgoCD Deployment') {
stage('ArgoCD Deployment') {
steps {
steps {
script {
script {
sh 'kubectl apply -f argocd_deploy.yaml --validate=false '
// Appliquer le fichier YAML pour le déploiement avec ArgoCD
}
bat 'kubectl apply -f argocd_deploy.yaml --validate=false'
}
}
stage('Scale Deployment') {
steps {
script {
// Mise à l'échelle des réplicas à 5
sh 'kubectl scale deployment k8s-app-deployment --replicas=3'
// Vérification de la mise à l'échelle
sh 'kubectl get pods -o wide'
}
}
}
stage('Monitor Scaling') {
steps {
script {
// Affichage des métriques de ressources
sh 'kubectl top pods'
// Optionnel : vérifier l'état de la charge sur les nœuds
sh 'kubectl top nodes'
}
}
}
}
}
}
...
@@ -70,23 +48,21 @@ pipeline {
...
@@ -70,23 +48,21 @@ pipeline {
steps {
steps {
script {
script {
// Vérifier que les ressources Kubernetes sont correctement déployées
// Vérifier que les ressources Kubernetes sont correctement déployées
sh 'kubectl get all -n default'
bat 'kubectl get all -n default'
sh 'kubectl get pv'
bat 'kubectl get pv'
sh 'kubectl get pvc'
bat 'kubectl get pvc'
sh 'kubectl get hpa'
bat 'kubectl get hpa'
}
}
}
}
}
}
}
}
post {
post {
always {
success {
script {
echo 'L\'image Docker a été poussée avec succès sur Docker Hub.'
sh 'kubectl delete pods --field-selector=status.phase=Succeeded'
}
failure {
echo 'Le pipeline a échoué.'
}
}
echo 'Pipeline terminé et nettoyage effectué'
}
}
}
}
}
charts/values.yaml
View file @
b24294ba
# Deployment configuration
# Deployment configuration
appName
:
k8s
-app
appName
:
odoo
-app
replicaCount
:
2
replicaCount
:
2
containerName
:
k8s
-app
containerName
:
odoo
-app
image
:
image
:
repository
:
khadydiagne/
k8s
_app
repository
:
khadydiagne/
odoo
_app
tag
:
latest
tag
:
latest
containerPort
:
80
86
containerPort
:
80
69
resources
:
resources
:
requests
:
requests
:
cpu
:
"
50m"
cpu
:
"
50m"
...
@@ -16,26 +16,26 @@ resources:
...
@@ -16,26 +16,26 @@ resources:
volume
:
volume
:
name
:
storage-volume
name
:
storage-volume
mountPath
:
/data
mountPath
:
/data
persistentVolumeClaim
:
k8s
-app-pvc
persistentVolumeClaim
:
odoo
-app-pvc
# Service configuration
# Service configuration
service
:
service
:
name
:
k8s
-app-service
# Nom du service à exposer dans l'Ingress
name
:
odoo
-app-service
# Nom du service à exposer dans l'Ingress
port
:
80
port
:
80
targetPort
:
80
86
targetPort
:
80
69
type
:
ClusterIP
type
:
ClusterIP
# Ingress configuration
# Ingress configuration
ingress
:
ingress
:
class
:
"
nginx"
# Ajouter la classe ingress ici
class
:
"
nginx"
# Ajouter la classe ingress ici
rewriteTarget
:
"
/"
rewriteTarget
:
"
/"
host
:
k8s
-app.local
host
:
odoo
-app.local
path
:
/
path
:
/
pathType
:
Prefix
pathType
:
Prefix
# Persistent Volume configuration
# Persistent Volume configuration
pv
:
pv
:
name
:
k8s
-app-pv
name
:
odoo
-app-pv
capacity
:
1Gi
capacity
:
1Gi
accessMode
:
ReadWriteOnce
accessMode
:
ReadWriteOnce
reclaimPolicy
:
Retain
reclaimPolicy
:
Retain
...
@@ -43,7 +43,7 @@ pv:
...
@@ -43,7 +43,7 @@ pv:
# Persistent Volume Claim configuration
# Persistent Volume Claim configuration
pvc
:
pvc
:
name
:
k8s
-app-pvc
name
:
odoo
-app-pvc
accessMode
:
ReadWriteOnce
accessMode
:
ReadWriteOnce
storage
:
1Gi
storage
:
1Gi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment