@Override public void build(String name, DeploymentData deploymentData, InputStream tarInputStream) throws IOException { final String sName = Names.sanitize(name); ensureImageStreams(sName); ensureBuildConfig(sName, deploymentData, this.config.getBuilderImageStreamTag(), this.config.getImageStreamNamespace()); openShiftClient.buildConfigs().withName(sName) .instantiateBinary() .fromInputStream(tarInputStream); }
@Primary @Bean @ConditionalOnProperty(value = "openshift.enabled", matchIfMissing = true, havingValue = "true") public NamespacedOpenShiftClient openShiftClient(OpenShiftConfigurationProperties openShiftConfigurationProperties) { return new DefaultOpenShiftClient(openShiftConfigurationProperties.getOpenShiftClientConfiguration()); }
public void testDeploy() { String name = "test-deployment"; OpenShiftConfigurationProperties config = new OpenShiftConfigurationProperties(); OpenShiftServiceImpl service = new OpenShiftServiceImpl(client, config); .withType("Recreate") .withNewResources() .addToLimits("memory", new Quantity(config.getDeploymentMemoryLimitMi() + "Mi")) .addToRequests("memory", new Quantity(config.getDeploymentMemoryRequestMi() + "Mi")) .endResources() .endStrategy() .withImagePullPolicy("Always") .withName(name) .addToEnv(new EnvVarBuilder().withName("LOADER_HOME").withValue(config.getIntegrationDataPath()).build()) .addToEnv(new EnvVarBuilder().withName("AB_JMX_EXPORTER_CONFIG").withValue("/tmp/src/prometheus-config.yml").build()) .addNewPort()
.withType("Recreate") .withNewResources() .addToLimits("memory", new Quantity(config.getDeploymentMemoryLimitMi() + "Mi")) .addToRequests("memory", new Quantity(config.getDeploymentMemoryRequestMi() + "Mi")) .endResources() .endStrategy() new EnvVar("LOADER_HOME", config.getIntegrationDataPath(), null), new EnvVar("AB_JMX_EXPORTER_CONFIG", "/tmp/src/prometheus-config.yml", null)) .addNewPort()
new EnvVar("MAVEN_OPTS", config.getMavenOptions(), null), new EnvVar("BUILD_LOGLEVEL", config.isDebug() ? "5" : "1", null)