Package io.fabric8.jenkins.openshiftsync
Class JenkinsUtils
- java.lang.Object
-
- io.fabric8.jenkins.openshiftsync.JenkinsUtils
-
public class JenkinsUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description JenkinsUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,ParameterDefinition>
addJobParamForBuildEnvs(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.JenkinsPipelineBuildStrategy strat, boolean replaceExisting)
static void
cancelBuild(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.Build build)
static void
cancelBuild(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.Build build, boolean deleted)
static boolean
cancelQueuedBuild(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.Build build)
static void
cancelQueuedBuilds(org.jenkinsci.plugins.workflow.job.WorkflowJob job, String bcUid)
static void
deleteRun(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.Build build)
static void
deleteRun(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
static String
getBuildConfigName(org.jenkinsci.plugins.workflow.job.WorkflowJob job)
static String
getFullJobName(org.jenkinsci.plugins.workflow.job.WorkflowJob job)
static Job
getJob(String job)
static org.jenkinsci.plugins.workflow.job.WorkflowJob
getJobFromBuild(io.fabric8.openshift.api.model.Build build)
static org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud
getKubernetesCloud()
static String
getRootUrl()
static void
handleBuildList(org.jenkinsci.plugins.workflow.job.WorkflowJob job, List<io.fabric8.openshift.api.model.Build> builds, BuildConfigProjectProperty buildConfigProjectProperty)
static void
maybeScheduleNext(org.jenkinsci.plugins.workflow.job.WorkflowJob job)
static List<Action>
setJobRunParamsFromEnv(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.JenkinsPipelineBuildStrategy strat, List<Action> buildActions)
static List<Action>
setJobRunParamsFromEnvAndUIParams(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.JenkinsPipelineBuildStrategy strat, List<Action> buildActions, ParametersAction params)
static boolean
triggerJob(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.Build build)
static void
updateJob(org.jenkinsci.plugins.workflow.job.WorkflowJob job, InputStream jobStream, String existingBuildRunPolicy, BuildConfigProjectProperty buildConfigProjectProperty)
static void
verifyEnvVars(Map<String,ParameterDefinition> paramMap, org.jenkinsci.plugins.workflow.job.WorkflowJob workflowJob, io.fabric8.openshift.api.model.BuildConfig buildConfig)
-
-
-
Method Detail
-
getRootUrl
public static String getRootUrl()
-
verifyEnvVars
public static void verifyEnvVars(Map<String,ParameterDefinition> paramMap, org.jenkinsci.plugins.workflow.job.WorkflowJob workflowJob, io.fabric8.openshift.api.model.BuildConfig buildConfig) throws AbortException
- Throws:
AbortException
-
addJobParamForBuildEnvs
public static Map<String,ParameterDefinition> addJobParamForBuildEnvs(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.JenkinsPipelineBuildStrategy strat, boolean replaceExisting) throws IOException
- Throws:
IOException
-
setJobRunParamsFromEnv
public static List<Action> setJobRunParamsFromEnv(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.JenkinsPipelineBuildStrategy strat, List<Action> buildActions)
-
setJobRunParamsFromEnvAndUIParams
public static List<Action> setJobRunParamsFromEnvAndUIParams(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.JenkinsPipelineBuildStrategy strat, List<Action> buildActions, ParametersAction params)
-
triggerJob
public static boolean triggerJob(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.Build build) throws IOException
- Parameters:
job
- to triggerbuild
- linked to it- Returns:
- true if "job" has been triggered
- Throws:
IOException
- if job cannot be persisted
-
cancelBuild
public static void cancelBuild(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.Build build)
-
cancelBuild
public static void cancelBuild(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.Build build, boolean deleted)
-
deleteRun
public static void deleteRun(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
-
deleteRun
public static void deleteRun(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.Build build)
-
cancelQueuedBuild
public static boolean cancelQueuedBuild(org.jenkinsci.plugins.workflow.job.WorkflowJob job, io.fabric8.openshift.api.model.Build build)
-
cancelQueuedBuilds
public static void cancelQueuedBuilds(org.jenkinsci.plugins.workflow.job.WorkflowJob job, String bcUid)
-
getJobFromBuild
public static org.jenkinsci.plugins.workflow.job.WorkflowJob getJobFromBuild(io.fabric8.openshift.api.model.Build build)
-
updateJob
public static void updateJob(org.jenkinsci.plugins.workflow.job.WorkflowJob job, InputStream jobStream, String existingBuildRunPolicy, BuildConfigProjectProperty buildConfigProjectProperty) throws IOException
- Throws:
IOException
-
maybeScheduleNext
public static void maybeScheduleNext(org.jenkinsci.plugins.workflow.job.WorkflowJob job)
-
handleBuildList
public static void handleBuildList(org.jenkinsci.plugins.workflow.job.WorkflowJob job, List<io.fabric8.openshift.api.model.Build> builds, BuildConfigProjectProperty buildConfigProjectProperty)
-
getFullJobName
public static String getFullJobName(org.jenkinsci.plugins.workflow.job.WorkflowJob job)
-
getBuildConfigName
public static String getBuildConfigName(org.jenkinsci.plugins.workflow.job.WorkflowJob job)
-
getKubernetesCloud
public static org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud getKubernetesCloud()
-
-