From 0e462f02cdfc7b5052d10f13d6d2d16dd5a16cf2 Mon Sep 17 00:00:00 2001 From: Nicolas Arenas Date: Tue, 1 Oct 2024 14:12:34 +0200 Subject: [PATCH] Improve plugin installation --- tests/API-dhcp/Jenkinsfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/API-dhcp/Jenkinsfile b/tests/API-dhcp/Jenkinsfile index 8c41494..1c3d6cf 100644 --- a/tests/API-dhcp/Jenkinsfile +++ b/tests/API-dhcp/Jenkinsfile @@ -18,7 +18,14 @@ pipeline { steps { dir ('tests/API-dhcp') { echo "Install vagrant plugin" - sh 'vagrant plugin install vagrant-vmware-esxi' + sh ''' + if ! vagrant plugin list | grep -q vagrant-vmware-esxi; then + echo "Vagrant plugin vagrant-vmware-esxi not found. Installing..." + vagrant plugin install vagrant-vmware-esxi + else + echo "Vagrant plugin vagrant-vmware-esxi is already installed." + fi + ''' echo "Deploy API server for DHCP with Vagrant" sh 'vagrant up --provider=vmware_esxi --provision' }