Hello there.

I looking for an elagant way to execute code from the post {} section,
I want to write a clean Jenkinsfile and execute code from shared libraries 
as
posible.
 
In the post section I have the tipical  clean working directory like this:

always {
      cleanWs()
    }

I also send notification based on pipeline completion, I mean, aobrted , 
failed,
changed and so on,  but I want to call a function to do that, I want to 
remove the 
email code I have something like this:

emailext body: 'Check console output at $BUILD_URL to view the results. 
\n\n ${CHANGES} \n\n --------------------------------- \n${BUILD_LOG, 
maxLines=50, escapeHtml=false}',
                to: "${EMAIL_ADDRESSES}",
                subject: 'Pipeline Execution  Failed: $PROJECT_NAME - 
#$BUILD_NUMBER'

The problem seems that from the post you only can call an expected function 
of
type: always, changed, fixed, regression, aborted, success, unsuccessful, 
unstable, failure, notBuilt, cleanup.

Is there another way to accomplish this to write a more clean Post section?


Thanks
Regards

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ea74e553-88a7-4925-ade2-27462aaceab1n%40googlegroups.com.

Reply via email to