pipeline { agent any stages { stage('Ping') { steps { script { for (def i = 0; i < 500; i++) { echo "currentResult: ${currentBuild.currentResult}" sh "ping 127.0.0.1 -c 1" } } } } } }
pipeline { agent any stages { stage('Ping') { steps { script { for (def i = 0; i < 500; i++) { if (currentBuild.rawBuild.getActions(jenkins.model.InterruptedBuildAction.class).isEmpty()) { echo "currentResult: ${currentBuild.currentResult}" } else { echo "ABORTED" error("aborted") } sh "ping 127.0.0.1 -c 1" } } } } } }