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
a209095b
Commit
a209095b
authored
Dec 23, 2024
by
Mame Bineta Diakite
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Jenkinsfile
parent
0444232c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
16 deletions
+35
-16
Jenkinsfile
Jenkinsfile
+35
-16
No files found.
Jenkinsfile
View file @
a209095b
...
@@ -2,41 +2,60 @@ pipeline {
...
@@ -2,41 +2,60 @@ pipeline {
agent
any
agent
any
environment
{
environment
{
DOCKER_
CONFIG_PATH
=
"/jenkins/docker-config.json"
// Fichier monté dans le conteneur Jenkins
DOCKER_
IMAGE
=
"odoo-app"
DOCKER_REGISTRY
=
"registry.gitlab.com/binetaci/image-odoo"
DOCKER_REGISTRY
=
"registry.gitlab.com/binetaci/image-odoo"
IMAGE_NAME
=
"odoo-app
"
CHART_PATH
=
"odoo-chart
"
HELM_RELEASE
=
"chart-odoo"
KUBE_NAMESPACE
=
"
odoo
KUBE_CONTEXT
=
"minikube"
// Contexte Kubernetes utilisé
HELM_RELEASE
=
"odoo"
GOOGLE_CHAT_WEBHOOK
=
"https://chat.googleapis.com/v1/spaces/AAAACNlaIpk/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=RuFeBsALb8RwwvnHGneayfHq1r5fMc6rUtoKLlQr-DA
"
KUBE_CONTEXT
=
"minikube
"
}
}
stages
{
stages
{
stage
(
'C
heckou
t'
)
{
stage
(
'C
loner le dépô
t'
)
{
steps
{
steps
{
checkout
scm
checkout
scm
}
}
}
}
stage
(
'
Build Docker Image
'
)
{
stage
(
'
Construire l’image Docker
'
)
{
steps
{
steps
{
script
{
script
{
docker
.
withCustomRegistryAuth
(
DOCKER_CONFIG_PATH
)
{
sh
"""
def
image
=
docker
.
build
(
"${DOCKER_REGISTRY}/${IMAGE_NAME}:${env.BUILD_NUMBER}"
)
docker build -t ${DOCKER_REGISTRY}:${env.BUILD_NUMBER} .
docker login ${DOCKER_REGISTRY} -u ${env.GITLAB_USERNAME} -p ${env.GITLAB_ACCESS_TOKEN}
docker push ${DOCKER_REGISTRY}:${env.BUILD_NUMBER}
"""
}
}
}
}
}
}
stage
(
'Déployer avec Helm'
)
{
steps
{
script
{
sh
"""
helm upgrade --install ${HELM_RELEASE} ${CHART_PATH} \
--namespace ${KUBE_NAMESPACE} \
--set image.repository=${DOCKER_REGISTRY} \
--set image.tag=${env.BUILD_NUMBER}
"""
}
}
}
}
stage
(
'
Push Docker Image
'
)
{
stage
(
'
Notifier ArgoCD
'
)
{
steps
{
steps
{
script
{
script
{
docker
.
withCustomRegistryAuth
(
DOCKER_CONFIG_PATH
)
{
sh
"""
def
image
=
docker
.
image
(
"${DOCKER_REGISTRY}/${IMAGE_NAME}:${env.BUILD_NUMBER}"
)
argocd app sync ${HELM_RELEASE}
image
.
push
()
"""
}
}
}
}
}
}
}
}
post
{
always
{
echo
"Pipeline terminé."
}
}
}
}
}
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