2025-05-17 22:33:19 +00:00

33 lines
862 B
Groovy

pipeline {
agent any
environment {
ANSIBLE_INVENTORY = 'jenkins-update/inventory.ini'
ANSIBLE_PLAYBOOK = 'jenkins-update/update_debian.yml'
}
stages {
stage('Clone git') {
steps {
// Attention : cela supprimera tous les fichiers dans le répertoire de travail
sh "rm -rf *"
// Clonage du dépôt Git
sh "git clone https://git.zestes.fr/garfi/jenkins-update.git"
}
}
stage('Run Ansible Playbook') {
steps {
// Construction et exécution de la commande Ansible
sh "ansible-playbook -i ${ANSIBLE_INVENTORY} ${ANSIBLE_PLAYBOOK}"
}
}
}
post {
always {
// Nettoyage de l'espace de travail
cleanWs()
}
}
}