Actualiser Jenkinsfile
This commit is contained in:
parent
c1117391cd
commit
e406e1979c
5
Jenkinsfile
vendored
5
Jenkinsfile
vendored
@ -9,7 +9,7 @@ pipeline {
|
|||||||
stages {
|
stages {
|
||||||
stage('Clone git') {
|
stage('Clone git') {
|
||||||
steps {
|
steps {
|
||||||
sh "rm -rf *"
|
// Clonage du dépôt Git
|
||||||
sh "git clone https://git.zestes.fr/garfi/jenkins-update.git"
|
sh "git clone https://git.zestes.fr/garfi/jenkins-update.git"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -17,7 +17,9 @@ pipeline {
|
|||||||
stage('Run Ansible Playbook') {
|
stage('Run Ansible Playbook') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
|
// Construction de la commande Ansible
|
||||||
def ansibleCommand = "ansible-playbook -i ${ANSIBLE_INVENTORY} ${ANSIBLE_PLAYBOOK}"
|
def ansibleCommand = "ansible-playbook -i ${ANSIBLE_INVENTORY} ${ANSIBLE_PLAYBOOK}"
|
||||||
|
// Exécution de la commande Ansible
|
||||||
sh ansibleCommand
|
sh ansibleCommand
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -26,6 +28,7 @@ pipeline {
|
|||||||
|
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
|
// Nettoyage de l'espace de travail
|
||||||
cleanWs()
|
cleanWs()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user