use of com.openshift.restclient.model.build.IJenkinsPipelineStrategy in project jbosstools-openshift by jbosstools.
the class ResourceDetailsContentProvider method addStrategyTypeProperties.
private void addStrategyTypeProperties(Collection<ResourceProperty> properties, IBuildStrategy buildStrategy) {
if (buildStrategy == null || buildStrategy.getType() == null) {
properties.add(new UnknownResourceProperty(LABEL_STRATEGY));
return;
}
properties.add(new ResourceProperty(LABEL_STRATEGY, buildStrategy.getType().toString()));
switch(buildStrategy.getType()) {
case BuildStrategyType.SOURCE:
ISourceBuildStrategy sti = (ISourceBuildStrategy) buildStrategy;
properties.add(new ResourceProperty("builder image", StringUtils.toStringOrNull(sti.getImage())));
break;
case BuildStrategyType.DOCKER:
IDockerBuildStrategy docker = (IDockerBuildStrategy) buildStrategy;
properties.add(new ResourceProperty("base image", StringUtils.toStringOrNull(docker.getBaseImage())));
break;
case BuildStrategyType.CUSTOM:
ICustomBuildStrategy custom = (ICustomBuildStrategy) buildStrategy;
properties.add(new ResourceProperty("builder image", StringUtils.toStringOrNull(custom.getImage())));
break;
case BuildStrategyType.JENKINS_PIPELINE:
IJenkinsPipelineStrategy jenkins = (IJenkinsPipelineStrategy) buildStrategy;
properties.add(new ResourceProperty("jenkins file", StringUtils.removeAll(StringUtils.getLineSeparator(), jenkins.getJenkinsfile())));
properties.add(new ResourceProperty("jenkins file path", StringUtils.toStringOrNull(jenkins.getJenkinsfilePath())));
break;
default:
}
}
Aggregations