Add Jenkinsfile for CI/CD pipeline
This commit is contained in:
parent
02fe2cdf8b
commit
5a92812927
31
backend/Jenkinsfile
vendored
Normal file
31
backend/Jenkinsfile
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
pipeline {
|
||||
agent any
|
||||
environment {
|
||||
COMPOSE_DIR = '/srv/devops/the-tip-top'
|
||||
SERVICE = 'backend'
|
||||
}
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
stage('Build & Deploy') {
|
||||
steps {
|
||||
sh """
|
||||
cd ${COMPOSE_DIR}
|
||||
docker compose up -d ${SERVICE}
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
echo "✅ Backend déployé avec succès."
|
||||
}
|
||||
failure {
|
||||
echo "❌ Échec du déploiement du backend."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user