Search in sources :

Example 1 with IJenkinsPipelineStrategy

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:
    }
}
Also used : ISourceBuildStrategy(com.openshift.restclient.model.build.ISourceBuildStrategy) IDockerBuildStrategy(com.openshift.restclient.model.build.IDockerBuildStrategy) ICustomBuildStrategy(com.openshift.restclient.model.build.ICustomBuildStrategy) IJenkinsPipelineStrategy(com.openshift.restclient.model.build.IJenkinsPipelineStrategy)

Aggregations

ICustomBuildStrategy (com.openshift.restclient.model.build.ICustomBuildStrategy)1 IDockerBuildStrategy (com.openshift.restclient.model.build.IDockerBuildStrategy)1 IJenkinsPipelineStrategy (com.openshift.restclient.model.build.IJenkinsPipelineStrategy)1 ISourceBuildStrategy (com.openshift.restclient.model.build.ISourceBuildStrategy)1