Created
February 28, 2020 23:05
-
-
Save matheusvt2/49e762510a60dab5503fca170194e08c to your computer and use it in GitHub Desktop.
post example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post {//Apos o build (com ou sem erros) sempre executa esses comandos | |
always { | |
script{ | |
if(env.ProjectEnv == "VENV"){ | |
println "Apagando arquivos temporários..." | |
sh "conda remove --yes -p ${WORKSPACE}/VirtualEnv/${BUILD_TAG} --all" | |
sh ''' cd ${WORKSPACE} | |
ls -la | |
rm -fr * | |
ls -la | |
''' | |
println "Arquivos temporários apagados." | |
}else if(env.ProjectEnv == "DOCKER"){ | |
println "Removendo build nome ${dockerhub}/jenkins-python-full-pipeline:${BUILD_NUMBER}" | |
sh "docker rmi ${dockerhub}/jenkins-python-full-pipeline:${BUILD_NUMBER}" | |
sh "docker logout" | |
} | |
} | |
} | |
}//Fim do post Pipeline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment