pipeline { agent { node { label 'jenkins-slave' } } environment { ESXI_PASS = credentials('VI_PASSWORD') } stages { stage('Prepare environment') { dir ('tests/API-dhcp/') { steps { echo "Deploy API server for DHCP with Vagrant" sh 'vagrant up' } } } stage('Check Installation') { steps { echo 'Testing..' } } stage ('Run API tests') { steps { echo 'Running API tests' } } stage('Clean up') { steps { echo "Destroy API server for DHCP with Vagrant" sh 'vagrant destroy -f' } } } }