Compare commits

...

44 Commits

Author SHA1 Message Date
Andrea Tarocchi ef771a1e2a
Updated to fuse 7.5 (#39) 6 years ago
Andrea Tarocchi c747726ec0
Updated to fuse 7.5 6 years ago
Andrea Tarocchi f56d8412d3
Merge branch 'redhat' into redhat-sb2 6 years ago
Andrea Tarocchi 7dd9e46ff2
Better image name variable handling in documentation. 6 years ago
Andrea Tarocchi 1684d0425a
ENTESB-12212: [SB2] Configmap booster is using different health check then other boosters. 6 years ago
Andrea Tarocchi a1d2a8df6b
ENTESB-11864 was affecting sb2 boosters as well: fixed. 6 years ago
Andrea Tarocchi 68bc48cc5b
Update to fuse 6.4 sb2 dependencies. (#36) 6 years ago
Andrea Tarocchi 74114b5759
Update to fuse 6.4 sb2 dependencies. 6 years ago
Andrea Tarocchi 44470c8c96
Upgraded to fuse 7.4 (#35) 6 years ago
Andrea Tarocchi 9afe0d9bd6
Upgraded to fuse 7.4 6 years ago
Andrea Tarocchi f346a6dac1
Initial adaptation to sb2 7 years ago
Andrea Tarocchi 56c32968ac
Upgrade to 7.3.1 BOMs. (#33) 7 years ago
Andrea Tarocchi ac1a41be9d
Upgrade to 7.3.1 BOMs. 7 years ago
Andrea Tarocchi 8b141944c2
Update to Fuse 7.3 (#32) 7 years ago
Aurélien Pupier 390e8b1504 Remove duplicated declaration of openshift-client in pom #30 7 years ago
Andrea Tarocchi 66ee01d932
Update to Fuse 7.3 7 years ago
Andrea Tarocchi 157f27310e Merge remote-tracking branch 'upstream/master' into redhat 7 years ago
Andrea Tarocchi 07d1c28855 fixed opeshift-client version 7 years ago
Andrea Tarocchi c4e9627532 Merge branch 'master' into redhat 7 years ago
Andrea Tarocchi 4cab6b9fe8
Merge pull request #26 from valdar/update7.2 7 years ago
Andrea Tarocchi a3d3720319 Updated to 7.2 7 years ago
Andrea Tarocchi 009af43a19 Fixed pom 7 years ago
Andrea Tarocchi cc7e34772b Merge remote-tracking branch 'upstream/master' into redhat 7 years ago
Andrea Tarocchi f6ede294da Udated to 7.1 dependencies 7 years ago
Andrea Tarocchi 4053c1c00e Polished pom.xml 7 years ago
MelissaFlinn 1e6b7882e3 doc review and minor edit 7 years ago
Andrea Tarocchi c62fed1b79 Merge branch 'master' into redhat 7 years ago
Andrea Tarocchi e12a022623 Merge branch 'master' into redhat 8 years ago
Andrea Tarocchi 434f717c69 Merge branch 'master' into redhat 8 years ago
Andrea Tarocchi dca5d31a72 Merge branch 'master' into redhat 8 years ago
Andrea Tarocchi ff4f924232 Update to fuse 7.0.1 8 years ago
Andrea Tarocchi f83b50be00 Merge branch 'master' into redhat 8 years ago
Andrea Tarocchi 623bdcb9d1 Added imageToImport in Jenkinsfile boosterBuild(...) call. 8 years ago
Andrea Tarocchi 2dcdb1acae
Merge pull request #10 from valdar/redhat 8 years ago
Andrea Tarocchi f1909ae5b9 Merge branch 'master' into redhat 8 years ago
Andrea Cosentino 78caf8d489
Merge pull request #6 from llowinge/master 8 years ago
Andrea Tarocchi e803b2d824 Merge branch 'master' into redhat 8 years ago
Andrea Cosentino be65facbe4
Merge pull request #4 from jboss-fuse/ENTESB-9124-rh 8 years ago
Andrea Cosentino 19d5a5bd4d ENTESB-9124 - Change api path of fuse-rest-http-booster in readme 8 years ago
Andrea Tarocchi 4badbdabc7 Fixed typo in .openshiftio template 8 years ago
Andrea Tarocchi 83c0ba4a5b Merge branch 'master' into redhat 8 years ago
Andrea Tarocchi 3bea0004f0 Aligned dependencies and images to fuse 7.0.0 GA 8 years ago
Andrea Tarocchi 58fcb4650b Merge branch 'master' into redhat 8 years ago
Andrea Tarocchi 0fe753a734 /changed for red hat versions and images. 8 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: 'fabric8/s2i-java:latest'
value: 'registry.access.redhat.com/fuse7/fuse-java-openshift:1.0'
required: true
objects:
- apiVersion: v1
@ -47,9 +47,9 @@ objects:
name: fuse-java-openshift
spec:
tags:
- name: "latest"
- name: "1.0"
annotations:
description: Fabric8 Java S2I images.
description: Red Hat Fuse 7.0 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:latest
name: fuse-java-openshift:1.0
incremental: true
type: Source
triggers:
@ -169,7 +169,7 @@ objects:
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /health
path: /actuator/health
port: 8080
scheme: HTTP
initialDelaySeconds: 180
@ -186,7 +186,7 @@ objects:
protocol: TCP
readinessProbe:
httpGet:
path: /health
path: /actuator/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()
boosterBuild("registry.access.redhat.com/fuse7/fuse-java-openshift:1.0")

45
README.adoc

@ -1,4 +1,7 @@
: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
@ -75,6 +78,48 @@ 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,41 +15,18 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-boot.version>1.5.13.RELEASE</spring-boot.version>
<camel.version>2.21.2</camel.version>
<!-- versions of Maven plugins -->
<fmp.version>3.5.40</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>
<fuse.bom.version>7.5.0.fuse-sb2-750029-redhat-00003</fuse.bom.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<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>
<groupId>org.jboss.redhat-fuse</groupId>
<artifactId>fuse-springboot-bom</artifactId>
<version>${fuse.bom.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>
@ -106,6 +83,10 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-swagger-java-starter</artifactId>
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>openshift-client</artifactId>
</dependency>
<!-- Test -->
<dependency>
@ -137,14 +118,9 @@
<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>
@ -171,9 +147,9 @@
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<groupId>org.jboss.redhat-fuse</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<version>${fuse.bom.version}</version>
<executions>
<execution>
<goals>
@ -237,9 +213,9 @@
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<groupId>org.jboss.redhat-fuse</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>${fmp.version}</version>
<version>${fuse.bom.version}</version>
<executions>
<execution>
<goals>

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

@ -16,7 +16,6 @@
package com.redhat.fuse.boosters.rest.http;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@ -43,10 +42,11 @@ 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.context.embedded.LocalServerPort;
import org.springframework.boot.web.server.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 + "/health", String.class));
Assert.assertEquals( "{\"status\":\"UP\"}", this.restTemplate.getForObject("http://localhost:" + port + "/actuator/health", String.class));
}
}
}

Loading…
Cancel
Save