Add Jenkinsfile for CI/CD pipeline
All checks were successful
the-tip-top-backend/pipeline/head This commit looks good
All checks were successful
the-tip-top-backend/pipeline/head This commit looks good
This commit is contained in:
parent
5a92812927
commit
1058efc409
31
Jenkinsfile
vendored
Normal file
31
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