You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IMPORTANT: Important: Before using note that by default this App provides the minimum configurations for SpringBoot KJAR Service. See xref:anchor-7[How To Further Configure the App]
30
30
31
31
1. _Fork_ this repository for every new service (ie. this is just a baseline) and update *pom.xml* with new *GAV*.
32
-
2. Build and install in your local/central MAVEN repository the xref:anchor-5[Plugin for building KJAR Dependencies]
33
32
34
-
=== How To Use as locally Springboot App
33
+
=== How To Use as local Springboot App
35
34
[[anchor-2]]
36
35
37
36
first start at xref:anchor-1[How To Use this Repo]
38
37
39
-
1. _Run_ *JenkinspipelineBatch.sh* script to create KJARs binaries, a repository of their dependencies (along with the KJARs installed in it), configurations for the Springboot Runtime App (`your-service-name.xml` kie-server-state, `application-XXX.properties`) based on what is to run
40
-
* *[Parameter 1]* a list of KJARs to be loaded into Springboot App. The list must have the following format `containerAlias-1#RuntimeStrategy#GIT_REPO-1,containerAlias-2#RuntimeStrategy#GIT_REPO-2,containerAlias-N#RuntimeStrategy#GIT_REPO-N`
41
-
* *[Parameter 2]* Name of Business Service (will be used for `kie-server-state` config file name, `application-xxx.properties` configurations `kieserver.serverId`, `kieserver.Name`)
1. Configure the KJAR the Spring Boot RHPAM Runtime App will use
39
+
* Get the KJAR code locally if not available via public repo (NEXUS/Artifactory) and build the artifact in your local maven repo see xref:anchor-8[How To Deploy a KJAR into Central Maven Repo]). (some https://github.com/skoussou/JBossAutomationPlayground/tree/master/example-kjars[example KJARs here])
40
+
* Update the list of KJARs to be added (immutable service) to the Spring Boot App by modifying one of the following
41
+
[[anchor-2b]]
42
+
** *Option-1*: Add in `application-XXX.properties` the following 2 properties
43
+
*** `kieserver.classPathContainer=true`
44
+
*** `kieserver.autoScanDeployments=true`
45
+
** and *kie-maven-plugin* in `pom.xml` (see example https://github.com/elguardian/springboot-kjar-multiversion/blob/767dfada69a0777aae8d5870f22dd50aab21de3c/business-application-service/pom.xml#L53) *with the list of KJARs*
46
+
** *Option-2*: Add in `application-XXX.properties` only the following property
47
+
*** `kieserver.classPathContainer=true`
48
+
*** add a *Bean* in the code with the following content:
49
+
+
50
+
@Configuration
51
+
public class KieContainerDeployer {
52
+
@Bean
53
+
public KieContainerResource evaluation_v1() {
54
+
KieContainerResource container = new KieContainerResource("evaluation_v1", new ReleaseId("com.myspace", "Evaluation", "1.0.0-SNAPSHOT"), STARTED);
*** add *kie-maven-plugin* in `pom.xml` (see example https://github.com/elguardian/springboot-kjar-multiversion/blob/767dfada69a0777aae8d5870f22dd50aab21de3c/business-application-service/pom.xml#L53) (no need to explicitly list the KJARs in the plugin)
67
+
** *Option-3*: Add the plugin as in *Option 2* and in `application-XXX.properties` all KJARs as follows per KJAR
68
+
+
69
+
kieserver.deployments[0].alias=basic
70
+
kieserver.deployments[0].containerId=basic_100
71
+
kieserver.deployments[0].artifactId=basic-kjar
72
+
kieserver.deployments[0].groupId==com.redhat
73
+
kieserver.deployments[0].version=1.0.0
74
+
+
75
+
[[anchor-2c]]
76
+
* update the `kie-server-state` file (there are 2 examples in this repo business-application-service.xml, business-rules-application-service.xml)
77
+
** ensure the file name `your-service-name.xml` will match in all the `application-XXX.properties` the value of configurations `kieserver.serverId`, `kieserver.Name`). This is the name of the Business Service
78
+
** ensure there are in the `your-service-name.xml` a `<container>` section for each KieContainter/KJAR to be loaded at runtime
79
+
+
46
80
2. Run the Service as local SpringBoot App and xref:anchor-6[Use the KJAR Springboot Service APIs]
* use *-Dspring-boot.run.profiles=mysql* and *-P mysql* to use with an external Mysql database and update *_src/main/resources/application-mysql.properties_* with DB connection details
52
86
* use *-Dspring-boot.run.profiles=postgres* and *-P postgres* to use with an external PostgresSQL database and update *_src/main/resources/application-postgres.properties_* with DB connection details
87
+
* Access API at http://127.0.0.1:8090/rest/api-docs?url=http://localhost:8090/rest/server/swagger.json[http://127.0.0.1:8090/rest/api-docs?url=http://localhost:8090/rest/server/swagger.json]
88
+
53
89
54
90
55
91
=== How To Use as local Docker container
@@ -62,19 +98,9 @@ first start at xref:anchor-1[How To Use this Repo]
62
98
63
99
first start at xref:anchor-1[How To Use this Repo]
64
100
65
-
1. Configure in `pom.xml` under https://github.com/skoussou/springboot-business-app/blob/master/pom.xml#L87[artifacts section] the KJARs you plan to deploy in your service (*Important:* KJARs need to be deployed in NEXUS if using a central maven repo. See xref:anchor-8[How To Deploy a KJAR into Central Maven Repo])
2. Configure `your-service-name.xml` (see `business-application-service.xml` as an example and must match `application-openshift.properties` properties `kieserver.serverId`, `kieserver.Name`)
74
-
* one *<container>* sectio for each KJAR above
75
-
76
-
3. Configure the `artifactId` and `version` based on your `pom.xml` in the https://github.com/skoussou/springboot-business-app/blob/master/Dockerfile#L6[`Dockerfile`]
77
-
101
+
1. Configure in your RHPAM Spring Boot Service the KJARs (see xref:anchor-2b[How to Configure KJARs in immutbale RHPAM Service]) you plan to deploy in your service (*Important:* KJARs need to be deployed in NEXUS if using a central maven repo. See xref:anchor-8[How To Deploy a KJAR into Central Maven Repo])
102
+
2. Configure the `kie-server-state` file (see xref:anchor-2c[Configure KIE Server state file]) so that the resulting Openshift Spring Boot Image will contain the configured KIEContainers in
103
+
3. Configure the `artifactId` and `version` based on your `pom.xml` in the link:./src/main/docker/Dockerfile#L6[`Dockerfile`]
78
104
4. Configure database connection details in `application-openshift.properties` to connect to either an _external database_ or create a MySQL database service in openshift
79
105
80
106
* Create necessary *mysql* database service dependency (see `application-openshift.properties`)
@@ -88,20 +114,20 @@ first start at xref:anchor-1[How To Use this Repo]
88
114
89
115
5. Change the service name according to the `artifact-id` in your `pom.xml` for https://github.com/skoussou/springboot-business-app/blob/master/src/main/fabric8/service.yml[`service.yml`] and https://github.com/skoussou/springboot-business-app/blob/master/src/main/fabric8/route.yml[`route.yml`]
90
116
91
-
==== Run the service in K8s/Openshift cluster (fabric8) - NON-CICD
117
+
==== Run the service in K8s/Openshift cluster (JKube) - NON-CICD
92
118
93
-
first start at xref:anchor-4[How To Use in Openshift]
119
+
First start at xref:anchor-4[How To Use in Openshift]
94
120
95
121
1. Use the *openshift* profile to *Build App*, *Build KJAR Maven Dependencies Repo*, *Build Image with Repo*, *Create resoures bc/dc*
0 commit comments