... post { changed { if (currentBuild.resultIsBetterOrEqualTo('SUCCESS')) { echo "Previous build failed ${currentBuild?.getPreviousBuild()?.number} and now it has been fixed" } } } }...
pipeline {
agent any stages { stage ('release') { steps { script { echo "echo currentbuild ${BUILD_ID}" //sh 'exit 1' } } } } post { changed { script { echo "${currentBuild.getCurrentResult()}"
if (currentBuild.resultIsBetterOrEqualTo('SUCCESS')) { echo "Previous build failed ${currentBuild?.getPreviousBuild()?.number} and now it has been fixed" } } } }}
[Pipeline] node
Running on master in /var/jenkins_home/workspace/_scratch/test_def
[Pipeline] {
[Pipeline] stage
[Pipeline] { (release)
[Pipeline] script
[Pipeline] {
[Pipeline] echo
echo currentbuild 37
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] script
[Pipeline] {
[Pipeline] echo
SUCCESS
[Pipeline] echo
Previous build failed 36 and now it has been fixed
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ce3fbe5c-df26-471c-a804-1d6643650b9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/3nWDhDOPrE4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d93a3cf6-1eca-4d67-80cd-16d38eef01f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3b4ee108-9ecf-4977-a1a3-d3c1cecea0b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.