Groovy web console

subscribe to the feed Subscribe
to this

Wrapping post build

Published 2 months ago by Josefk with tags jenkins
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
void run_with_post_step(Closure post_step, List post_step_parameters, Closure block) {
    println("Running main pipeline")
    try {
    } finally {
        println("Running post step")

void my_teams_notification_post_step(String hook_url) {
    println("Would post to: ${hook_url}")

void my_customized_teams_notification_post_step(String hook_url, String special_information) {
    println("Would post to: ${hook_url}, including very special information: ${special_information}")

this.run_with_post_step(this.&my_teams_notification_post_step, [""]) {
    println("This is my first step of the pipeline!")

this.run_with_post_step(this.&my_customized_teams_notification_post_step, ["", "This is HUNT speaking, we got a lot of issues."]) {
    println("This is my first step of the special pipeline!")

this.run_with_post_step(this.&my_teams_notification_post_step, [""]) {
    throw new Exception("Oh no, something went wrong!")