Skip to content

Commit

Permalink
Merge pull request #37 from redhatHameed/qe-fixes
Browse files Browse the repository at this point in the history
updated fuse/amq version 7.4 and fixed issue
  • Loading branch information
bmozaffa authored Sep 13, 2019
2 parents d7232cd + a78c365 commit fc154e5
Show file tree
Hide file tree
Showing 24 changed files with 379 additions and 160 deletions.
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ pipeline {

serviceName = 'fuse-alert-service'
smokeTestOperation = 'cicd/alerts'
body = ''' { "alertType": "ACCIDENT", "firstName": "Abdul Hameed", "date": "11/8/2019", "phone": "78135955", "email": "ahameed@redhat.com", "description": "test"} '''
body = ''' { "alertType": "ACCIDENT", "firstName": "user1", "date": "11/8/2019", "phone": "78135955", "email": "user1@abc.com", "description": "test"} '''
makePostRequest("http://${serviceName}:8080/${smokeTestOperation}", body, 'POST')

serviceName = 'maingateway-service'
Expand Down Expand Up @@ -305,7 +305,7 @@ pipeline {

serviceName = 'fuse-alert-service'
smokeTestOperation = 'cicd/alerts'
body = ''' { "alertType": "ACCIDENT", "firstName": "Abdul Hameed", "date": "11/8/2019", "phone": "78135955", "email": "ahameed@redhat.com", "description": "test"} '''
body = ''' { "alertType": "ACCIDENT", "firstName": "user1", "date": "11/8/2019", "phone": "78135955", "email": "user1@abc.com", "description": "test"} '''
makePostRequest("http://${serviceName}:8080/${smokeTestOperation}", body, 'POST')

serviceName = 'maingateway-service'
Expand Down Expand Up @@ -503,7 +503,7 @@ pipeline {

serviceName = 'fuse-alert-service'
smokeTestOperation = 'cicd/alerts'
body = ''' { "alertType": "ACCIDENT", "firstName": "Abdul Hameed", "date": "11/8/2019", "phone": "78135955", "email": "ahameed@redhat.com", "description": "test"} '''
body = ''' { "alertType": "ACCIDENT", "firstName": "user1", "date": "11/8/2019", "phone": "78135955", "email": "user1@abc.com", "description": "test"} '''
makePostRequest("http://${serviceName}:8080/${smokeTestOperation}", body, 'POST')


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ After you have set the parameters and imported all of the pipeline templates, yo

![Pipeline View](images/pipeline_import_view.png "Pipeline View")

Please start the pipeline from `maingateway-service-pipeline`, `fuse-user-service-pipeline`, `fuse-alert-service-pipeline`, `nodejsalert-ui-pipeline` and then `publish-api-3scale` to publish API on 3scale.
Please start the pipeline from `fuse-user-service-pipeline`, `fuse-alert-service-pipeline`, `maingateway-service-pipeline` ,`nodejsalert-ui-pipeline` and then `publish-api-3scale` to publish API on 3scale.

With `aggregated-pipeline`, you can build the entire application including all of the above modules mentioned. If you choose this pipeline, by default, it will build the entire application, but you will also be asked to select which individual module you want to build. You will need to make your selection in your Jenkins console.

Expand Down
2 changes: 1 addition & 1 deletion cicd-3scale/3scaletoolbox/openapi-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"apikey" : [ ]
} ],

"host": "maingateway-service-rh-test.app.middleware.ocp.cloud.lab.eng.bos.redhat.com",
"host": "echo-api.3scale.net",
"basePath": "/cicd",
"schemes": [
"http"
Expand Down
2 changes: 1 addition & 1 deletion cicd-3scale/3scaletoolbox/openapi-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ securityDefinitions:
in: query
security:
- apikey: []
host: maingateway-service-rh-test.app.middleware.ocp.cloud.lab.eng.bos.redhat.com
host: echo-api.3scale.net
basePath: /cicd
schemes:
- http
12 changes: 6 additions & 6 deletions cicd-3scale/3scaletoolbox/pipeline-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ parameters:
value: master
required: true
- name: PRIVATE_BASE_URL
value: http://maingateway-service-rh-test.app.middleware.ocp.cloud.lab.eng.bos.redhat.com
required: true
value:
#required: true
- name: PUBLIC_PRODUCTION_WILDCARD_DOMAIN
value: app.middleware.ocp.cloud.lab.eng.bos.redhat.com
value:
- name: PUBLIC_STAGING_WILDCARD_DOMAIN
value: staging.app.middleware.ocp.cloud.lab.eng.bos.redhat.com
value:
- name: PRODUCTION_PUBLIC_BASE_URL
value: https://3scalefuse.app.middleware.ocp.cloud.lab.eng.bos.redhat.com
value:
#required: true
- name: STAGING_PUBLIC_BASE_URL
value: https://3scalefuse-staging.app.middleware.ocp.cloud.lab.eng.bos.redhat.com
value:
#required: true
- name: API_BASE_SYSTEM_NAME
value: 3scalefuse
Expand Down
4 changes: 2 additions & 2 deletions cicd-3scale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ Go to [studio.apicur.io](https://studio.apicur.io/), login and import the openap
```
or you can use same image version from [quay.io](https://quay.io/repository/redhat/3scale-toolbox?tag=v0.12.3&tab=tags)
5. Read [3scale-toolbox Configuration]( https://github.com/rh-integration/3scale-toolbox-jenkins-samples )
5. Read [3scale-toolbox Configuration](https://access.redhat.com/documentation/en-us/red_hat_3scale_api_management/2.6/html/operating_3scale/api-lifecyle-toolbox)
6. view [3scale-toolbox Jenkins File](https://raw.githubusercontent.com/rh-integration/IntegrationApp-Automation/master/cicd-3scale/3scaletoolbox/Jenkinsfile)
7. Create pipeline, update the pipeline parameters as per your environment .
```sh
oc new-app -f cicd-3scale/3scaletoolbox/pipeline-template.yaml -p IMAGE_NAMESPACE=rh-dev -p DEV_PROJECT=rh-dev -p TEST_PROJECT=rh-test -p PROD_PROJECT=rh-prod -p PRIVATE_BASE_URL=http://maingateway-service-rh-test.app.middleware.ocp.cloud.lab.eng.bos.redhat.com -p PUBLIC_PRODUCTION_WILDCARD_DOMAIN=app.middleware.ocp.cloud.lab.eng.bos.redhat.com -p PUBLIC_STAGING_WILDCARD_DOMAIN=staging.app.middleware.ocp.cloud.lab.eng.bos.redhat.com -p DEVELOPER_ACCOUNT_ID=developer
oc new-app -f cicd-3scale/3scaletoolbox/pipeline-template.yaml -p IMAGE_NAMESPACE=rh-dev -p DEV_PROJECT=rh-dev -p TEST_PROJECT=rh-test -p PROD_PROJECT=rh-prod -p PRIVATE_BASE_URL=<API_URL> -p PUBLIC_PRODUCTION_WILDCARD_DOMAIN=<WILDCARD_DOMAIN> -p PUBLIC_STAGING_WILDCARD_DOMAIN=staging.<WILDCARD_DOMAIN> -p DEVELOPER_ACCOUNT_ID=developer
```

Expand Down
6 changes: 3 additions & 3 deletions fuse-alert-service/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pipeline {
retry(5) {
serviceName = 'fuse-alert-service:8080'
smokeTestOperation = 'cicd/alerts'
body = ''' { "alertType": "ACCIDENT", "firstName": "Abdul Hameed", "date": "11/8/2019", "phone": "78135955", "email": "ahameed@redhat.com", "description": "test"} '''
body = ''' { "alertType": "ACCIDENT", "firstName": "user1", "date": "11/8/2019", "phone": "78135955", "email": "user1@abc.com", "description": "test"} '''
makePostRequest("http://${serviceName}/${smokeTestOperation}", body, 'POST')
}
}
Expand Down Expand Up @@ -87,7 +87,7 @@ pipeline {
retry(5) {
serviceName = 'fuse-alert-service:8080'
smokeTestOperation = 'cicd/alerts'
body = ''' { "alertType": "ACCIDENT", "firstName": "Abdul Hameed", "date": "11/8/2019", "phone": "78135955", "email": "ahameed@redhat.com", "description": "test"} '''
body = ''' { "alertType": "ACCIDENT", "firstName": "user1", "date": "11/8/2019", "phone": "78135955", "email": "user1@abc.com", "description": "test"} '''
makePostRequest("http://${serviceName}/${smokeTestOperation}", body, 'POST')
}
}
Expand Down Expand Up @@ -144,7 +144,7 @@ pipeline {
retry(5) {
serviceName = 'fuse-alert-service:8080'
smokeTestOperation = 'cicd/alerts'
body = ''' { "alertType": "ACCIDENT", "firstName": "Abdul Hameed", "date": "11/8/2019", "phone": "78135955", "email": "ahameed@redhat.com", "description": "test"} '''
body = ''' { "alertType": "ACCIDENT", "firstName": "user1", "date": "11/8/2019", "phone": "78135955", "email": "user1@abc.com", "description": "test"} '''
makePostRequest("http://${serviceName}/${smokeTestOperation}", body, 'POST')
}
}
Expand Down
3 changes: 2 additions & 1 deletion fuse-alert-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ post params :
```
view the API Doc

- <http://localhost:8080/cicd/fuse-alert-service.json>
- <http://localhost:8080/cicd/openapi.json
>
### Implementation

Expand Down
59 changes: 28 additions & 31 deletions fuse-alert-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,23 @@
<description>Fuse Integration Service - Alert Service</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- configure the versions you want to use here -->
<fuse.version>7.3.0.fuse-730058-redhat-00001</fuse.version>
<fabric8.version>3.0.11.fuse-730075-redhat-00001</fabric8.version>
<spring-boot.version>1.5.17.RELEASE</spring-boot.version>

<!-- maven plugin versions -->
<fabric8.maven.plugin.version>4.1.0</fabric8.maven.plugin.version>
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
<fuse.version>7.4.0.fuse-740036-redhat-00002</fuse.version>
<!-- Maven plugin versions -->
<maven-compiler-plugin.version>3.6.0</maven-compiler-plugin.version>
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
<!--<run.profiles>dev</run.profiles>-->
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-project-bom-camel-spring-boot</artifactId>
<version>${fabric8.version}</version>
<groupId>org.jboss.redhat-fuse</groupId>
<artifactId>fuse-springboot-bom</artifactId>
<version>${fuse.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -43,6 +36,16 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
Expand All @@ -57,14 +60,13 @@
<artifactId>camel-swagger-java-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
<version>5.11.0.redhat-630377</version>
<groupId>org.apache.camel</groupId>
<artifactId>camel-amqp-starter</artifactId>
</dependency>

<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
<groupId>org.messaginghub</groupId>
<artifactId>pooled-jms</artifactId>
<version>1.0.4.redhat-00004</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
Expand All @@ -87,21 +89,17 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
<version>2.1.6.RELEASE</version>

<version>2.1.6.RELEASE</version>
</dependency>

<!--health Check -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http</artifactId>
<version>2.21.0.fuse-730078-redhat-00001</version>

</dependency>
</dependencies>
<build>
Expand All @@ -116,8 +114,9 @@
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<groupId>org.jboss.redhat-fuse</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${fuse.version}</version>
<executions>
<execution>
<goals>
Expand All @@ -127,9 +126,9 @@
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<groupId>org.jboss.redhat-fuse</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>${fabric8.maven.plugin.version}</version>
<version>${fuse.version}</version>
<executions>
<execution>
<goals>
Expand All @@ -141,7 +140,6 @@
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>maven.central</id>
Expand Down Expand Up @@ -180,7 +178,6 @@
</snapshots>
</repository>
</repositories>

<pluginRepositories>
<pluginRepository>
<id>maven.central</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,39 @@
*/
package org.redhat.alertservice;

import org.apache.camel.component.amqp.AMQPConnectionDetails;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.beans.factory.annotation.Value;

/**
* A spring-boot application that includes a Camel route builder to setup the Camel routes
*/
@SpringBootApplication
@ImportResource({ "classpath:spring/amq.xml","classpath:spring/camel-context.xml"})
@ImportResource({ "classpath:spring/camel-context.xml"})
public class Application {

@Value("${activemq.broker.url}")
private String AMQ_BROKER_URL;

@Value("${activemq.broker.username}")
private String AMQ_BROKER_USERNAME;

@Value("${activemq.broker.password}")
private String AMQ_BROKER_PASSWORD;

// must have a main method spring-boot can run
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}


@Bean
AMQPConnectionDetails amqpConnection() {
return new AMQPConnectionDetails(AMQ_BROKER_URL, AMQ_BROKER_USERNAME, AMQ_BROKER_PASSWORD);
}


}
6 changes: 3 additions & 3 deletions fuse-alert-service/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ activemq:
# The following properties can be customized using the 'ACTIVEMQ_SERVICE_HOST' and 'ACTIVEMQ_SERVICE_PORT' environment variables.
# This is indeed done automatically by Kubernetes when the application is deployed in a namespace containing an instance of ActiveMQ named 'activemq'.
# The service defaults to localhost. You need to change these properties for development purposes only.
host: broker-amq-tcp
port: 61616
host: broker-amq-amqp
port: 5672
broker:
username: admin
password: admin

# The following property binds all previous configurations together
url: tcp://${${activemq.service.name}.service.host}:${${activemq.service.name}.service.port}
url: amqp://${${activemq.service.name}.service.host}:${${activemq.service.name}.service.port}
concurrent:
consumers: 10
pool:
Expand Down
10 changes: 5 additions & 5 deletions fuse-alert-service/src/main/resources/spring/camel-context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</onException>
<restConfiguration apiContextPath="/openapi.json" component="servlet"/>
<rest enableCORS="true" id="rest1" path="/">
<get id="openapi.json" produces="application/json" uri="fuse-alert-service.json">
<get id="openapi.json" produces="application/json" uri="openapi.json">
<description>Gets the openapi document for this service</description>
<route id="rest1-route1">
<setHeader headerName="Exchange.CONTENT_TYPE" id="setHeader-route1">
Expand All @@ -40,8 +40,8 @@
</route>
</get>
</rest>

<rest bindingMode="json" enableCORS="true" id="rest-137a1c4f-a95b-4701-9550-5c4c829b6931" path="/">
<rest bindingMode="json" enableCORS="true"
id="rest-137a1c4f-a95b-4701-9550-5c4c829b6931" path="/">
<post id="149fa303-f173-46b5-8c95-e83adb43008a"
type="org.redhat.alertservice.UserInfo" uri="alerts">
<to uri="direct:alert"/>
Expand All @@ -50,8 +50,8 @@
<route id="_Alert Service">
<from id="report" uri="direct:alert"/>
<log id="log-body" message="${body}"/>
<to id="_to1" uri="amq:topic:alert?exchangePattern=InOnly"/>
<to id="_to1" uri="amqp:topic:alert?exchangePattern=InOnly"/>
<process id="_Email Alert" ref="mailProcessor"/>
</route>
</camelContext>
</camelContext>
</beans>
2 changes: 1 addition & 1 deletion fuse-user-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ You can then access the REST API directly from your Web browser, e.g.:

- Getting the API docs:

curl http://localhost:8080/cicd/userservice-spec.json
curl http://localhost:8080/cicd/openapi.json

### Implementation
Expand Down
Loading

0 comments on commit fc154e5

Please sign in to comment.