Skip to content

Commit a99d257

Browse files
committed
docs and JenkinspipelineBatch.sh directory generic location
1 parent 3b3f732 commit a99d257

File tree

2 files changed

+32
-35
lines changed

2 files changed

+32
-35
lines changed

Diff for: JenkinspipelineBatch.sh

+21-33
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ fi
99

1010
KJAR_GAV_LIST=$1
1111
SB_APP_SERVICE=$2
12-
#SB_APP_REPO=$4
1312
CONTAINERS_XML=""
1413
KJAR_REPO=""
1514

@@ -28,7 +27,18 @@ mkdir ../kjar
2827

2928
KJAR_GAV_LIST=($KJAR_GAV_LIST)
3029

30+
# The Springboot Business Service App Directory Name
31+
APP_DIR=$(basename "$PWD")
3132

33+
# The path of the parent directory of the Springboot BUsiness Service App directory
34+
PARENT_DIR_PATH=$(dirname "$PWD")
35+
36+
37+
38+
echo
39+
echo "Application Directory: $APP_DIR"
40+
echo "Path : ${PARENT_DIR_PATH}/${APP_DIR}"
41+
echo
3242

3343
array=(${KJAR_GAV_LIST//","/" "})
3444

@@ -55,23 +65,25 @@ for ((i = 0; i < ${#array[@]}; ++i)); do
5565
echo '#---------------------------------------------------------------------------------------------------------------------------------'
5666
echo " Clone the repo for [$KJAR_NAME] for which the Business Service will be created [$KJAR_REPO]"
5767
echo '#---------------------------------------------------------------------------------------------------------------------------------'
58-
echo "git -C /home/stkousso/Stelios/sw11/git/PAM/start-business-apps/kjar clone $KJAR_REPO"
59-
git -C /home/stkousso/Stelios/sw11/git/PAM/start-business-apps/kjar clone $KJAR_REPO
68+
echo "git -C ${PARENT_DIR_PATH}/kjar clone $KJAR_REPO"
69+
git -C ${PARENT_DIR_PATH}/kjar clone $KJAR_REPO
6070
echo
6171
REPO_DIR="${KJAR_REPO##*/}"
6272
echo '#---------------------------------------------------------------------------------------------------------------------------------'
6373
echo " Create local Repo dependencies for KJAR ["$KJAR_NAME"] repo [$KJAR_REPO]"
6474
echo '#---------------------------------------------------------------------------------------------------------------------------------'
65-
echo "mvn -e -DskipTests dependency:go-offline -f ../kjar/$REPO_DIR/pom.xml --batch-mode -Djava.net.preferIPv4Stack=true -s ../springboot-business-app/settings.xml"
66-
mvn -e -q -DskipTests dependency:go-offline -f ../kjar/$REPO_DIR/pom.xml --batch-mode -Djava.net.preferIPv4Stack=true -s ../springboot-business-app/settings.xml
75+
#echo "mvn -e -DskipTests dependency:go-offline -f ../kjar/$REPO_DIR/pom.xml --batch-mode -Djava.net.preferIPv4Stack=true -s ../springboot-business-app/settings.xml"
76+
#mvn -e -q -DskipTests dependency:go-offline -f ../kjar/$REPO_DIR/pom.xml --batch-mode -Djava.net.preferIPv4Stack=true -s ../springboot-business-app/settings.xml
77+
echo "mvn -e -DskipTests dependency:go-offline -f ../kjar/$REPO_DIR/pom.xml --batch-mode -Djava.net.preferIPv4Stack=true -s ../${APP_DIR}/settings.xml"
78+
mvn -e -q -DskipTests dependency:go-offline -f ../kjar/$REPO_DIR/pom.xml --batch-mode -Djava.net.preferIPv4Stack=true -s ../${APP_DIR}/settings.xml
6779
echo
6880
echo '#---------------------------------------------------------------------------------------------------------------------------------'
6981
echo " Build and Deploy to local repository the KJAR ["$KJAR_REPO"]"
7082
echo '#---------------------------------------------------------------------------------------------------------------------------------'
7183
#echo "mvn clean deploy -f ../kjar/$REPO_DIR/pom.xml -s ../springboot-business-app/settings.xml -DaltReleaseDeploymentRepository=local-nexus::default::file://.local-m2-repository"
7284
#mvn clean deploy -q -f ../kjar/$REPO_DIR/pom.xml -s ../springboot-business-app/settings.xml -DaltReleaseDeploymentRepository=local-nexus::default::file://.local-m2-repository
73-
echo "mvn clean install -q -f ../kjar/$REPO_DIR/pom.xml -s ../springboot-business-app/settings.xml"
74-
mvn clean install -q -f ../kjar/$REPO_DIR/pom.xml -s ../springboot-business-app/settings.xml
85+
echo "mvn clean install -q -f ../kjar/$REPO_DIR/pom.xml -s ../${APP_DIR}/settings.xml"
86+
mvn clean install -q -f ../kjar/$REPO_DIR/pom.xml -s ../${APP_DIR}/settings.xml
7587
echo
7688
xslt_cmd="xsltproc extract-gav.xsl ../kjar/$REPO_DIR/pom.xml"
7789
# RELEASE_ID=${xsltproc extract-gav.xsl ../kjar/$REPO_DIR/pom.xml}
@@ -140,7 +152,6 @@ KEYS=(kieserver.serverId kieserver.serverName)
140152

141153
properties_dir='./src/main/resources'
142154
for ((i = 0; i < ${#KEYS[@]}; ++i)); do
143-
#filename='./src/main/resources/application.properties'
144155
filename=""
145156
#properties_dir='./src/main/resources'
146157

@@ -170,7 +181,8 @@ for ((i = 0; i < ${#KEYS[@]}; ++i)); do
170181

171182
done
172183

173-
rm -r $properties_dir"/.propertiesr"
184+
#rm -r $properties_dir"/*.propertiesr"
185+
rm -r ${PARENT_DIR_PATH}/${APP_DIR}"/src/main/resources/*.propertiesr"
174186

175187
echo
176188
echo "Update/Create $SB_APP_SERVICE.xml with [$KJAR_GAV_LIST] to load the KJAR(s)"
@@ -234,28 +246,4 @@ echo "$XML_CONFIG" > "$SB_APP_SERVICE.xml"
234246
echo
235247
echo
236248

237-
#echo '##################################################################################################################################'
238-
#echo " Clone the KJAR repo for which the Business Service will be created ["$KJAR_REPO"]"
239-
#echo '##################################################################################################################################'
240-
#echo 'git -C /home/stkousso/Stelios/sw11/git/PAM/start-business-apps/kjar clone https://github.com/skoussou/JBossAutomationPlayground'
241-
#git -C /home/stkousso/Stelios/sw11/git/PAM/start-business-apps/kjar clone https://github.com/skoussou/JBossAutomationPlayground
242-
243-
244-
#ls -l ../kjar/JBossAutomationPlayground/example-kjars/basic-kjar
245-
246-
#echo '##################################################################################################################################'
247-
#echo " Create local Repo dependencies for KJAR ["$KJAR_REPO"]"
248-
#echo '##################################################################################################################################'
249-
#echo 'mvn -e -DskipTests dependency:go-offline -f ../kjar/JBossAutomationPlayground/example-kjars/basic-kjar/pom.xml --batch-mode -Djava.net.preferIPv4Stack=true -s ../springboot-business-app/settings.xml'
250-
#mvn -e -DskipTests dependency:go-offline -f ../kjar/JBossAutomationPlayground/example-kjars/basic-kjar/pom.xml --batch-mode -Djava.net.preferIPv4Stack=true -s ../springboot-business-app/settings.xml
251-
252-
253-
#echo '##################################################################################################################################'
254-
#echo " Build and Deploy to local repository the KJAR ["$KJAR_REPO"]"
255-
#echo '##################################################################################################################################'
256-
#echo 'mvn clean deploy -f ../kjar/JBossAutomationPlayground/example-kjars/basic-kjar/pom.xml -s ../springboot-business-app/settings.xml -DaltReleaseDeploymentRepository=local-nexus::default::file://.local-m2-repository'
257-
#mvn clean deploy -f ../kjar/JBossAutomationPlayground/example-kjars/basic-kjar/pom.xml -s ../springboot-business-app/settings.xml -DaltReleaseDeploymentRepository=local-nexus::default::file://.local-m2-repository
258-
259-
260-
261249

Diff for: README.adoc

+11-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ first start at xref:anchor-1[How To Use this Repo]
6262

6363
first start at xref:anchor-1[How To Use this Repo]
6464

65-
1. Configure in `pom.xml` the KJARs you plan to deploy in your service (KJARs need to be deployed in NEXUS if using a central maven repo)
65+
1. Configure in `pom.xml` 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])
6666

6767
<artifacts>
6868
<gav>com.redhat:basic-kjar:1.0.0</gav>
@@ -169,11 +169,12 @@ first start at xref:anchor-4[How To Use in Openshift]
169169

170170
* Find Process IDs in KIEContainer
171171

172+
curl -k -u user:user -X GET "http://127.0.0.1:8090/rest/server/containers/retail/processes/" -H "accept: application/json"
172173
curl -k -u user:user -X GET "http://business-application-service-dev-pam.apps.cluster-workshop-d20a.workshop-d20a.example.opentlc.com/rest/server/containers/{ALIAS or CONTAINERID}/processes/" -H "accept: application/json"
173174

174-
175175
* Find Process Details(eg. process Variables) based on Process ID
176176

177+
curl -k -u user:user -X GET "http://127.0.0.1:8090/rest/server/containers/retail/processes/definitions/my-process" -H "accept: application/json"
177178
curl -k -u user:user -X GET "http://business-application-service-dev-pam.apps.cluster-workshop-d20a.workshop-d20a.example.opentlc.com/rest/server/containers/containers/{ALIAS or CONTAINERID}/processes/definitions/{ProcessID}" -H "accept: application/json"
178179

179180
* Start Process
@@ -184,6 +185,7 @@ first start at xref:anchor-4[How To Use in Openshift]
184185

185186
* Retrieve instances of processes in KIEContainer (status 1=Active, 2=Completed, 3=Error)
186187

188+
curl -u 'user:user' -X GET "http://127.0.0.1:8090/rest/server/containers/example-retail-credit-kjar-1.0.0/processes/instances?status=2&page=0&pageSize=10&sortOrder=true" -H "accept: application/json" -H "content-type: application/json"
187189
curl -k -u user:user -X GET "http://business-application-service-dev-pam.apps.cluster-workshop-d20a.workshop-d20a.example.opentlc.com/rest/server/containers/{CONTAINER_ID}/processes/instances?status=2&page=0&pageSize=10&sortOrder=true" -H "accept: application/json" -H "content-type: application/json"
188190

189191

@@ -196,6 +198,13 @@ first start at xref:anchor-4[How To Use in Openshift]
196198
3. Timers
197199
4. APIs
198200

201+
[[anchor-8]]
202+
== How To Deploy a KJAR into Central Maven Repo
203+
204+
* See example at: https://github.com/skoussou/basic-kjar/blob/b4a11571cc099203ecfd0cf08b11f6957c56842d/pom.xml#L9[Basic KJAR distributionManagement]
205+
* With https://github.com/skoussou/basic-kjar/blob/b4a11571cc099203ecfd0cf08b11f6957c56842d/settings.xml#L12[server configs in settings.xml matching the distributionManagement ids] execute:
206+
207+
mvn clean deploy -s settings.xml
199208

200209
Resources: Docs on Openshift DSL Pipeline creation
201210

0 commit comments

Comments
 (0)