Compare commits

..

3 Commits

Author SHA1 Message Date
Andrea Tarocchi 68a6a522e1
Bump FMP version to 4.3.1 (#37) 6 years ago
svor 29527583ca Update FMP version to 4.3.1 6 years ago
svor 3affacd4da Bump fmp version to 4.0.0 6 years ago
  1. 12
      .openshiftio/application.yaml
  2. 2
      Jenkinsfile
  3. 45
      README.adoc
  4. 54
      pom.xml
  5. 6
      src/test/java/com/redhat/fuse/boosters/rest/http/HttpRequestKT.java
  6. 6
      src/test/java/com/redhat/fuse/boosters/rest/http/HttpRequestTest.java

12
.openshiftio/application.yaml

@ -38,7 +38,7 @@ parameters:
- name: BUILDER_IMAGE_NAME
description: Name of the image to use as a builder image
displayName: Builder Image Name
value: 'registry.access.redhat.com/fuse7/fuse-java-openshift:1.0'
value: 'fabric8/s2i-java:latest'
required: true
objects:
- apiVersion: v1
@ -47,9 +47,9 @@ objects:
name: fuse-java-openshift
spec:
tags:
- name: "1.0"
- name: "latest"
annotations:
description: Red Hat Fuse 7.0 Java S2I images.
description: Fabric8 Java S2I images.
iconClass: icon-jboss
tags: 'builder,jboss-fuse,java,xpaas,hidden'
version: '1.0'
@ -99,7 +99,7 @@ objects:
forcePull: true
from:
kind: ImageStreamTag
name: fuse-java-openshift:1.0
name: fuse-java-openshift:latest
incremental: true
type: Source
triggers:
@ -169,7 +169,7 @@ objects:
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /actuator/health
path: /health
port: 8080
scheme: HTTP
initialDelaySeconds: 180
@ -186,7 +186,7 @@ objects:
protocol: TCP
readinessProbe:
httpGet:
path: /actuator/health
path: /health
port: 8080
scheme: HTTP
initialDelaySeconds: 10

2
Jenkinsfile vendored

@ -13,4 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
boosterBuild("registry.access.redhat.com/fuse7/fuse-java-openshift:1.0")
boosterBuild()

45
README.adoc

@ -1,7 +1,4 @@
:launchURL: https://developers.redhat.com/launch
:image-registry: registry.access.redhat.com
:image-prefix: /fuse7/
:image-name-version: fuse-java-openshift:1.0
= REST API Level 0 - Fuse Booster
@ -78,48 +75,6 @@ Wait until you can see that the pod for the `fuse-rest-http-booster` application
. Click the URL to access the Greeting Service and then follow the instructions on that page.
[#single-node-without-preinstalled-images]
=== Running the booster on a single-node OpenShift cluster without preinstalled images
To deploy your booster to a running single-node OpenShift cluster without preinstalled images:
. Download the project and extract the archive on your local filesystem.
. Log in to your OpenShift cluster:
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ oc login -u developer -p developer
----
. Create a new OpenShift project for the booster:
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ oc new-project MY_PROJECT_NAME
----
. Import base images in your newly created project (MY_PROJECT_NAME):
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ oc import-image {image-name-version} --from={image-registry}{image-prefix}{image-name-version} --confirm
----
. Build and deploy the project to the OpenShift cluster:
+
[source,bash,options="nowrap",subs="attributes+"]
----
$ mvn clean -DskipTests fabric8:deploy -Popenshift -Dfabric8.generator.fromMode=istag -Dfabric8.generator.from=MY_PROJECT_NAME/{image-name-version}
----
. In your browser, navigate to the `MY_PROJECT_NAME` project in the OpenShift console.
Wait until you can see that the pod for the `fuse-rest-http-booster` application has started up.
. On the project's `Overview` page, locate the URL for the `fuse-rest-http-booster` application. The URL uses this form:
`http://fuse-rest-http-booster-MY_PROJECT_NAME.OPENSHIFT_IP_ADDR.nip.io`.
. Click the URL to access the greetings service application and then follow the instructions on that page.
== Running the booster on OpenShift Online
To deploy this booster directly to OpenShift Online when you create the project at link:{launchURL}[].

54
pom.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@ -15,18 +15,41 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<fuse.bom.version>7.5.0.fuse-sb2-750029-redhat-00003</fuse.bom.version>
<spring-boot.version>1.5.13.RELEASE</spring-boot.version>
<camel.version>2.21.2</camel.version>
<!-- versions of Maven plugins -->
<fmp.version>4.3.1</fmp.version>
<!-- version of Arquillian -->
<arquillian.cube.version>1.17.1</arquillian.cube.version>
<arquillian.version>1.4.0.Final</arquillian.version>
<openshift-client.version>4.0.7</openshift-client.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.redhat-fuse</groupId>
<artifactId>fuse-springboot-bom</artifactId>
<version>${fuse.bom.version}</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-dependencies</artifactId>
<version>${camel.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.arquillian.cube</groupId>
<artifactId>arquillian-cube-bom</artifactId>
<version>${arquillian.cube.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
@ -83,10 +106,6 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-swagger-java-starter</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>openshift-client</artifactId>
</dependency>
<!-- Test -->
<dependency>
@ -118,9 +137,14 @@
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-standalone</artifactId>
<version>${arquillian.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>openshift-client</artifactId>
<version>${openshift-client.version}</version>
</dependency>
</dependencies>
<build>
@ -147,9 +171,9 @@
</configuration>
</plugin>
<plugin>
<groupId>org.jboss.redhat-fuse</groupId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${fuse.bom.version}</version>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
@ -213,9 +237,9 @@
<build>
<plugins>
<plugin>
<groupId>org.jboss.redhat-fuse</groupId>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>${fuse.bom.version}</version>
<version>${fmp.version}</version>
<executions>
<execution>
<goals>

6
src/test/java/com/redhat/fuse/boosters/rest/http/HttpRequestKT.java

@ -16,6 +16,7 @@
package com.redhat.fuse.boosters.rest.http;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@ -42,11 +43,10 @@ public class HttpRequestKT {
public void templateTest() {
File template = new File(".openshiftio/application.yaml");
assertTrue(template.exists());
Map<String, String> templateParameters = Collections.singletonMap("SOURCE_REPOSITORY_URL",
"https://github.com/jboss-fuse/fuse-rest-http-booster");
Map<String, String> templateParameters = Collections.singletonMap("SOURCE_REPOSITORY_URL","https://github.com/jboss-fuse/fuse-rest-http-booster");
List<HasMetadata> resources = client.templates().load(template).process(templateParameters).getItems();
for (HasMetadata res : resources) {
for(HasMetadata res : resources){
client.resource(res).createOrReplace();
}

6
src/test/java/com/redhat/fuse/boosters/rest/http/HttpRequestTest.java

@ -4,7 +4,7 @@ import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.context.embedded.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.test.context.junit4.SpringRunner;
@ -26,6 +26,6 @@ public class HttpRequestTest {
@Test
public void healthShouldReturnOkMessage() throws Exception {
Assert.assertEquals( "{\"status\":\"UP\"}", this.restTemplate.getForObject("http://localhost:" + port + "/actuator/health", String.class));
Assert.assertEquals( "{\"status\":\"UP\"}", this.restTemplate.getForObject("http://localhost:" + port + "/health", String.class));
}
}
}
Loading…
Cancel
Save