All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javaposse.jobdsl.dsl.helpers.publisher.PostBuildTaskContext.groovy Maven / Gradle / Ivy

There is a newer version: 1.22-rxd-2
Show newest version
package javaposse.jobdsl.dsl.helpers.publisher
import com.google.common.base.Preconditions
import groovy.transform.Canonical
import javaposse.jobdsl.dsl.helpers.Context

class PostBuildTaskContext implements Context {
    def tasks = []

    def task(String logText, String script, boolean escalate = false, boolean runIfSuccessful = false) {
        Preconditions.checkArgument(logText != null && logText.length() > 0, "Log Text to match is required!")
        Preconditions.checkArgument(script != null && script.length() > 0, "Script to run is required!")

        tasks << new PostBuildTask(
            logText: logText,
            script: script,
            operator: 'AND',
            escalateStatus: escalate,
            runIfJobSuccessful: runIfSuccessful
        )
    }

    @Canonical
    static class PostBuildTask {
        String logText
        String operator
        String script
        boolean escalateStatus
        boolean runIfJobSuccessful
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy