Search in sources :

Example 1 with IBuildConfigBuilder

use of com.openshift.restclient.model.build.IBuildConfigBuilder in project jbosstools-openshift by jbosstools.

the class CreateApplicationFromImageJob method addToGeneratedResources.

@Override
protected void addToGeneratedResources(Map<String, IResource> resources, final Connection connection, final String name, final IProject project) {
    IBuildConfigBuilder builder = connection.getResourceBuilder(IBuildConfigBuilder.class);
    IBuildConfig bc = builder.named(name).inNamespace(project.getName()).fromGitSource().fromGitUrl(buildConfigModel.getGitRepositoryUrl()).usingGitReference(buildConfigModel.getGitReference()).inContextDir(buildConfigModel.getContextDir()).end().usingSourceStrategy().fromImageStreamTag(buildConfigModel.getBuilderImageName()).inNamespace(buildConfigModel.getBuilderImageNamespace()).withEnvVars(createEnvVars()).end().buildOnSourceChange(buildConfigModel.isConfigWebHook()).buildOnConfigChange(buildConfigModel.isConfigChangeTrigger()).buildOnImageChange(buildConfigModel.isImageChangeTrigger()).toImageStreamTag(new DockerImageURI(name).getNameAndTag()).build();
    resources.put(ResourceKind.BUILD_CONFIG, bc);
}
Also used : DockerImageURI(com.openshift.restclient.images.DockerImageURI) IBuildConfig(com.openshift.restclient.model.IBuildConfig) IBuildConfigBuilder(com.openshift.restclient.model.build.IBuildConfigBuilder)

Aggregations

DockerImageURI (com.openshift.restclient.images.DockerImageURI)1 IBuildConfig (com.openshift.restclient.model.IBuildConfig)1 IBuildConfigBuilder (com.openshift.restclient.model.build.IBuildConfigBuilder)1