javaposse.jobdsl.dsl.helpers.publisher.PostBuildTaskContext.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of job-dsl-core Show documentation
Show all versions of job-dsl-core Show documentation
Javaposse jenkins job-dsl-core
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