the-tip-top-frontend/Jenkinsfile
2025-10-30 11:22:08 +00:00

50 lines
877 B
Groovy

pipeline {
agent { docker { image 'node:20' } }
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Install dependencies') {
steps {
sh 'npm install'
}
}
stage('Build Next.js app') {
steps {
sh 'npm run build'
}
}
stage('Build Docker image') {
steps {
sh 'docker build -t the-tip-top-frontend .'
}
}
stage('Deploy') {
steps {
sh '''
echo "🚀 Déploiement du frontend via Docker Compose..."
cd /srv/devops/the-tip-top
docker compose down the-tip-top-frontend || true
docker compose up -d --build the-tip-top-frontend
'''
}
}
}
post {
success {
echo "✅ Déploiement réussi !"
}
failure {
echo "❌ Échec du pipeline Frontend"
}
}
}