Move vagrant destroy server to post action
parent
139102eec8
commit
a6968ca83a
|
@ -43,20 +43,17 @@ pipeline {
|
|||
echo 'Running API tests'
|
||||
}
|
||||
}
|
||||
stage('Clean up') {
|
||||
steps {
|
||||
dir ('tests/API-dhcp') {
|
||||
echo "Destroy API server for DHCP with Vagrant"
|
||||
// sh 'vagrant destroy -f'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
script {
|
||||
echo "El trabajo ha finalizado con éxito. Destruyendo máquina Vagrant..."
|
||||
sh 'vagrant destroy -f'
|
||||
}
|
||||
}
|
||||
always {
|
||||
script {
|
||||
def userCause = currentBuild.rawBuild.getCause(hudson.model.Cause$UserIdCause)
|
||||
|
||||
if (userCause != null) {
|
||||
// Si fue lanzado manualmente, obtener el usuario y su correo desde las propiedades de Jenkins
|
||||
def userId = userCause.getUserId()
|
||||
|
|
Loading…
Reference in New Issue