Actualiser Jenkinsfile
This commit is contained in:
parent
3fa36cda4d
commit
3aaefd36b9
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@ -9,15 +9,29 @@ pipeline {
|
||||
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 {
|
||||
script {
|
||||
// Construction de la commande Ansible
|
||||
def ansibleCommand = "ansible-playbook -i ${ANSIBLE_INVENTORY} ${ANSIBLE_PLAYBOOK}"
|
||||
// Exécution de la commande Ansible
|
||||
sh ansibleCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
// Nettoyage de l'espace de travail
|
||||
cleanWs()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user